src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.ts/TypeHierarchyTreePeekWidget/_updatePreview
class TypeHierarchyTreePeekWidget:	private async _updatePreview() {
		const [element] = this._tree.getFocus();
		if (!element) {
			return;
		}

		this._previewDisposable.clear();

		// update: editor and editor highlights
		const options: IModelDecorationOptions = {
			description: 'type-hierarchy-decoration',
			stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
			className: 'type-decoration',
			overviewRuler: {
				color: themeColorFromId(peekView.peekViewEditorMatchHighlight),
				position: OverviewRulerLane.Center
			},
		};

		let previewUri: URI;
		if (this._direction === TypeHierarchyDirection.Supertypes) {
			// supertypes: show super types and highlight focused type
			previewUri = element.parent ? element.parent.item.uri : element.model.root.uri;
		} else {
			// subtypes: show sub types and highlight focused type
			previewUri = element.item.uri;
		}

		const value = await this._textModelService.createModelReference(previewUri);
		this._editor.setModel(value.object.textEditorModel);

		// set decorations for type ranges
		const decorations: IModelDeltaDecoration[] = [];
		let fullRange: IRange | undefined;
		const loc = { uri: element.item.uri, range: element.item.selectionRange };
		if (loc.uri.toString() === previewUri.toString()) {
			decorations.push({ range: loc.range, options });
			fullRange = !fullRange ? loc.range : Range.plusRange(loc.range, fullRange);
		}
		if (fullRange) {
			this._editor.revealRangeInCenter(fullRange, ScrollType.Immediate);
			const decorationsCollection = this._editor.createDecorationsCollection(decorations);
			this._previewDisposable.add(toDisposable(() => decorationsCollection.clear()));
		}
		this._previewDisposable.add(value);

		// update: title
		const title = this._direction === TypeHierarchyDirection.Supertypes
			? localize('supertypes', "Supertypes of '{0}'", element.model.root.name)
			: localize('subtypes', "Subtypes of '{0}'", element.model.root.name);
		this.setTitle(title);
	}