From b275fc78500589d291bd9515f6afcf458b410a97 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 26 Jul 2017 23:13:11 +0200 Subject: [PATCH] introduce IColorDecorationExtraOptions clean up monaco.d.ts --- src/vs/editor/common/editorCommon.ts | 11 -- .../common/model/textModelWithDecorations.ts | 22 +++- src/vs/editor/common/modes.ts | 17 +-- .../colorPicker/browser/colorPicker.ts | 39 ++++--- .../contrib/colorPicker/common/color.ts | 17 +++ .../hover/browser/modesContentHover.ts | 101 ++++++++++-------- src/vs/editor/contrib/hover/common/hover.ts | 8 +- src/vs/monaco.d.ts | 31 +----- .../api/node/extHostTypeConverters.ts | 8 +- .../api/extHostLanguageFeatures.test.ts | 4 +- 10 files changed, 122 insertions(+), 136 deletions(-) create mode 100644 src/vs/editor/contrib/colorPicker/common/color.ts diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index cbac71a94f4..313e090044b 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -25,7 +25,6 @@ import * as editorOptions from 'vs/editor/common/config/editorOptions'; import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; import { ICursors, CursorConfiguration } from 'vs/editor/common/controller/cursorCommon'; import { ThemeColor } from 'vs/platform/theme/common/themeService'; -import { Color } from 'vs/base/common/color'; /** * Vertical Lane in the overview ruler of the editor. @@ -62,12 +61,6 @@ export interface IModelDecorationOverviewRulerOptions { position: OverviewRulerLane; } -export type IColorFormat = string | { opaque: string, transparent: string }; -export interface IColorInfo { - color: Color; - format: IColorFormat; - availableFormats: IColorFormat[]; -} /** * Options for a model decoration. */ @@ -89,10 +82,6 @@ export interface IModelDecorationOptions { * Array of MarkedString to render as the decoration message. */ hoverMessage?: MarkedString | MarkedString[]; - /** - * Color with mode to render in the color picker. - */ - colorInfo?: IColorInfo; /** * Should the decoration expand to encompass a whole line. */ diff --git a/src/vs/editor/common/model/textModelWithDecorations.ts b/src/vs/editor/common/model/textModelWithDecorations.ts index 37478acdf29..2a7de9ea092 100644 --- a/src/vs/editor/common/model/textModelWithDecorations.ts +++ b/src/vs/editor/common/model/textModelWithDecorations.ts @@ -879,15 +879,23 @@ export class ModelDecorationOverviewRulerOptions implements editorCommon.IModelD let lastStaticId = 0; +// TODO@Joao +// This was introduced to solve the color problem. +// We don't want to expose colors in decorations, although +// we piggyback on decorations to implement colors in the model. +export interface IModelDecorationExtraOptions { + __extraOptions?: any; +} + export class ModelDecorationOptions implements editorCommon.IModelDecorationOptions { public static EMPTY: ModelDecorationOptions; - public static register(options: editorCommon.IModelDecorationOptions): ModelDecorationOptions { + public static register(options: editorCommon.IModelDecorationOptions & IModelDecorationExtraOptions): ModelDecorationOptions { return new ModelDecorationOptions(++lastStaticId, options); } - public static createDynamic(options: editorCommon.IModelDecorationOptions): ModelDecorationOptions { + public static createDynamic(options: editorCommon.IModelDecorationOptions & IModelDecorationExtraOptions): ModelDecorationOptions { return new ModelDecorationOptions(0, options); } @@ -895,7 +903,6 @@ export class ModelDecorationOptions implements editorCommon.IModelDecorationOpti readonly stickiness: editorCommon.TrackedRangeStickiness; readonly className: string; readonly hoverMessage: MarkedString | MarkedString[]; - readonly colorInfo: editorCommon.IColorInfo; readonly glyphMarginHoverMessage: MarkedString | MarkedString[]; readonly isWholeLine: boolean; readonly showIfCollapsed: boolean; @@ -906,13 +913,13 @@ export class ModelDecorationOptions implements editorCommon.IModelDecorationOpti readonly inlineClassName: string; readonly beforeContentClassName: string; readonly afterContentClassName: string; + readonly extraOptions: any; - private constructor(staticId: number, options: editorCommon.IModelDecorationOptions) { + private constructor(staticId: number, options: editorCommon.IModelDecorationOptions & IModelDecorationExtraOptions) { this.staticId = staticId; this.stickiness = options.stickiness || editorCommon.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges; this.className = options.className ? cleanClassName(options.className) : strings.empty; this.hoverMessage = options.hoverMessage || []; - this.colorInfo = options.colorInfo || undefined; this.glyphMarginHoverMessage = options.glyphMarginHoverMessage || strings.empty; this.isWholeLine = options.isWholeLine || false; this.showIfCollapsed = options.showIfCollapsed || false; @@ -923,6 +930,10 @@ export class ModelDecorationOptions implements editorCommon.IModelDecorationOpti this.inlineClassName = options.inlineClassName ? cleanClassName(options.inlineClassName) : strings.empty; this.beforeContentClassName = options.beforeContentClassName ? cleanClassName(options.beforeContentClassName) : strings.empty; this.afterContentClassName = options.afterContentClassName ? cleanClassName(options.afterContentClassName) : strings.empty; + + if (options.__extraOptions) { + this.extraOptions = options.__extraOptions; + } } public equals(other: ModelDecorationOptions): boolean { @@ -944,6 +955,7 @@ export class ModelDecorationOptions implements editorCommon.IModelDecorationOpti && markedStringsEquals(this.hoverMessage, other.hoverMessage) && markedStringsEquals(this.glyphMarginHoverMessage, other.glyphMarginHoverMessage) && this.overviewRuler.equals(other.overviewRuler) + && this.extraOptions === other.extraOptions ); } } diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index f0f7df21274..f70cc4aa5de 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -156,7 +156,7 @@ export interface IState { * A hover represents additional information for a symbol or word. Hovers are * rendered in a tooltip-like widget. */ -export interface MarkedStringHover { +export interface Hover { /** * The contents of this hover. */ @@ -170,21 +170,6 @@ export interface MarkedStringHover { range: IRange; } -// TODO@michel documentation -export interface ColorHover { - color: Color; - format: IColorFormat; - availableFormats: IColorFormat[]; - /** - * The range to which this hover applies. When missing, the - * editor will use the range at the current position or the - * current position itself. - */ - range: IRange; -} - -export type Hover = MarkedStringHover | ColorHover; - /** * The hover provider interface defines the contract between extensions and * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature. diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPicker.ts b/src/vs/editor/contrib/colorPicker/browser/colorPicker.ts index f6b8f92e224..2cda3cb7103 100644 --- a/src/vs/editor/contrib/colorPicker/browser/colorPicker.ts +++ b/src/vs/editor/contrib/colorPicker/browser/colorPicker.ts @@ -3,16 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICommonCodeEditor, IEditorContribution, IModelDecorationsChangeAccessor, IModelDeltaDecoration } from "vs/editor/common/editorCommon"; -import { editorContribution } from "vs/editor/browser/editorBrowserExtensions"; -import { ICodeEditor } from "vs/editor/browser/editorBrowser"; -import { IDisposable, dispose } from "vs/base/common/lifecycle"; -import { registerThemingParticipant } from "vs/platform/theme/common/themeService"; -import { editorWidgetBackground, editorWidgetBorder } from "vs/platform/theme/common/colorRegistry"; -import { ColorProviderRegistry, IColorInfo } from "vs/editor/common/modes"; -import { TPromise } from "vs/base/common/winjs.base"; -import { getColors } from "vs/editor/contrib/colorPicker/common/colorPicker"; -import { IRange } from "vs/editor/common/core/range"; +import { ICommonCodeEditor, IEditorContribution, IModelDecorationsChangeAccessor, IModelDeltaDecoration } from 'vs/editor/common/editorCommon'; +import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; +import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorWidgetBackground, editorWidgetBorder } from 'vs/platform/theme/common/colorRegistry'; +import { ColorProviderRegistry, IColorInfo } from 'vs/editor/common/modes'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { getColors } from 'vs/editor/contrib/colorPicker/common/colorPicker'; +import { IRange } from 'vs/editor/common/core/range'; +import { IColorDecorationExtraOptions } from '../common/color'; @editorContribution export class ColorPicker implements IEditorContribution { @@ -111,18 +112,16 @@ export class ColorPicker implements IEditorContribution { endColumn: c.range.endColumn }; - const decoration = { - range: range, - options: { - colorInfo: { - color: c.color, - format: c.format, - availableFormats: c.availableFormats - } - } + const extraOptions: IColorDecorationExtraOptions = { + color: c.color, + format: c.format, + availableFormats: c.availableFormats }; - newDecorations.push(decoration); + // TODO@Joao + const options = { __extraOptions: extraOptions } as any; + + newDecorations.push({ range, options }); } this.currentDecorations = changeAccessor.deltaDecorations(this.currentDecorations, newDecorations); diff --git a/src/vs/editor/contrib/colorPicker/common/color.ts b/src/vs/editor/contrib/colorPicker/common/color.ts new file mode 100644 index 00000000000..1fac0b97830 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/common/color.ts @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IColorFormat } from 'vs/editor/common/modes'; +import { Color } from 'vs/base/common/color'; + +export interface IColorDecorationExtraOptions { + readonly color: Color; + readonly format: IColorFormat; + readonly availableFormats: IColorFormat[]; +} + +export function isColorDecorationOptions(options: any): options is IColorDecorationExtraOptions { + return !!(options && (options as any).color); +} \ No newline at end of file diff --git a/src/vs/editor/contrib/hover/browser/modesContentHover.ts b/src/vs/editor/contrib/hover/browser/modesContentHover.ts index 83e51cfeadd..264ff23d3c0 100644 --- a/src/vs/editor/contrib/hover/browser/modesContentHover.ts +++ b/src/vs/editor/contrib/hover/browser/modesContentHover.ts @@ -12,25 +12,38 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { renderMarkedString } from 'vs/base/browser/htmlContentRenderer'; import { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener'; import { IModeService } from 'vs/editor/common/services/modeService'; -import { Range } from 'vs/editor/common/core/range'; +import { IRange, Range } from 'vs/editor/common/core/range'; import { Position } from 'vs/editor/common/core/position'; -import { HoverProviderRegistry, Hover } from 'vs/editor/common/modes'; +import { HoverProviderRegistry, Hover, IColorFormat } from 'vs/editor/common/modes'; import { tokenizeToString } from 'vs/editor/common/modes/textToHtmlTokenizer'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { getHover, isColorHover } from '../common/hover'; +import { getHover } from '../common/hover'; import { HoverOperation, IHoverComputer } from './hoverOperation'; import { ContentHoverWidget } from './hoverWidgets'; import { textToMarkedString, MarkedString } from 'vs/base/common/htmlContent'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; import { ColorPickerModel } from "vs/editor/contrib/colorPicker/browser/colorPickerModel"; import { ColorPickerWidget } from "vs/editor/contrib/colorPicker/browser/colorPickerWidget"; -import { IColorInfo } from 'vs/editor/common/editorCommon'; -import { ColorFormatter } from "vs/editor/contrib/colorPicker/common/colorFormatter"; +import { isColorDecorationOptions } from 'vs/editor/contrib/colorPicker/common/color'; +import { ColorFormatter } from 'vs/editor/contrib/colorPicker/common/colorFormatter'; +import { Color } from 'vs/base/common/color'; + +class ColorHover { + + constructor( + public readonly range: IRange, + public readonly color: Color, + public readonly format: IColorFormat, + public readonly availableFormats: IColorFormat[] + ) { } +} + +type HoverPart = Hover | ColorHover; -class ModesContentComputer implements IHoverComputer { +class ModesContentComputer implements IHoverComputer { private _editor: ICodeEditor; - private _result: Hover[]; + private _result: HoverPart[]; private _range: Range; constructor(editor: ICodeEditor) { @@ -47,7 +60,7 @@ class ModesContentComputer implements IHoverComputer { this._result = []; } - computeAsync(): TPromise { + computeAsync(): TPromise { const model = this._editor.getModel(); if (!HoverProviderRegistry.has(model)) { @@ -60,7 +73,7 @@ class ModesContentComputer implements IHoverComputer { )); } - computeSync(): Hover[] { + computeSync(): HoverPart[] { const lineNumber = this._range.startLineNumber; if (lineNumber > this._editor.getModel().getLineCount()) { @@ -68,7 +81,7 @@ class ModesContentComputer implements IHoverComputer { return []; } - const hasHoverContent = (contents: MarkedString | MarkedString[] | IColorInfo) => { + const hasHoverContent = (contents: MarkedString | MarkedString[]) => { return contents && (!Array.isArray(contents) || (contents).length > 0); }; @@ -79,45 +92,49 @@ class ModesContentComputer implements IHoverComputer { const startColumn = (d.range.startLineNumber === lineNumber) ? d.range.startColumn : 1; const endColumn = (d.range.endLineNumber === lineNumber) ? d.range.endColumn : maxColumn; - if (startColumn > this._range.startColumn || this._range.endColumn > endColumn || (!hasHoverContent(d.options.hoverMessage) && !hasHoverContent(d.options.colorInfo))) { + if (startColumn > this._range.startColumn || this._range.endColumn > endColumn) { return null; } const range = new Range(this._range.startLineNumber, startColumn, this._range.startLineNumber, endColumn); - let contents: MarkedString[]; - if (d.options.hoverMessage) { - if (Array.isArray(d.options.hoverMessage)) { - contents = [...d.options.hoverMessage]; - } else { - contents = [d.options.hoverMessage]; + // TOOD@Joao + const options = d.options as any; + const extraOptions = options && options.extraOptions; + + if (isColorDecorationOptions(extraOptions)) { + console.log('found color!'); + const { color, format, availableFormats } = extraOptions; + return new ColorHover(range, color, format, availableFormats); + } else { + if (!hasHoverContent(d.options.hoverMessage)) { + return null; } - } - const colorInfo = d.options.colorInfo; + let contents: MarkedString[]; - if (colorInfo) { - return { - color: colorInfo.color, - format: colorInfo.format, - availableFormats: colorInfo.availableFormats, - range: range, - }; - } + if (d.options.hoverMessage) { + if (Array.isArray(d.options.hoverMessage)) { + contents = [...d.options.hoverMessage]; + } else { + contents = [d.options.hoverMessage]; + } + } - return { contents, range }; + return { contents, range }; + } }); return result.filter(d => !!d); } - onResult(result: Hover[], isFromSynchronousComputation: boolean): void { + onResult(result: HoverPart[], isFromSynchronousComputation: boolean): void { // Always put synchronous messages before asynchronous ones if (isFromSynchronousComputation) { this._result = result.concat(this._result.sort((a, b) => { - if (isColorHover(a)) { // sort picker messages at to the top + if (a instanceof ColorHover) { // sort picker messages at to the top return -1; - } else if (isColorHover(b)) { + } else if (b instanceof ColorHover) { return 1; } return 0; @@ -127,15 +144,15 @@ class ModesContentComputer implements IHoverComputer { } } - getResult(): Hover[] { + getResult(): HoverPart[] { return this._result.slice(0); } - getResultWithLoadingMessage(): Hover[] { + getResultWithLoadingMessage(): HoverPart[] { return this._result.slice(0).concat([this._getLoadingMessage()]); } - private _getLoadingMessage(): Hover { + private _getLoadingMessage(): HoverPart { return { range: this._range, contents: [textToMarkedString(nls.localize('modesContentHover.loading', "Loading..."))] @@ -147,10 +164,10 @@ export class ModesContentHoverWidget extends ContentHoverWidget { static ID = 'editor.contrib.modesContentHoverWidget'; - private _messages: Hover[]; + private _messages: HoverPart[]; private _lastRange: Range; private _computer: ModesContentComputer; - private _hoverOperation: HoverOperation; + private _hoverOperation: HoverOperation; private _highlightDecorations: string[]; private _isChangingDecorations: boolean; private _openerService: IOpenerService; @@ -169,9 +186,9 @@ export class ModesContentHoverWidget extends ContentHoverWidget { this._hoverOperation = new HoverOperation( this._computer, - (result: Hover[]) => this._withResult(result, true), + result => this._withResult(result, true), null, - (result: any) => this._withResult(result, false) + result => this._withResult(result, false) ); } @@ -209,7 +226,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget { if (this._showAtPosition.lineNumber !== range.startLineNumber) { this.hide(); } else { - var filteredMessages: Hover[] = []; + var filteredMessages: HoverPart[] = []; for (var i = 0, len = this._messages.length; i < len; i++) { var msg = this._messages[i]; var rng = msg.range; @@ -244,7 +261,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget { } } - _withResult(result: Hover[], complete: boolean): void { + private _withResult(result: HoverPart[], complete: boolean): void { this._messages = result; if (this._lastRange && this._messages.length > 0) { @@ -254,7 +271,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget { } } - private _renderMessages(renderRange: Range, messages: Hover[]): void { + private _renderMessages(renderRange: Range, messages: HoverPart[]): void { // update column from which to show var renderColumn = Number.MAX_VALUE, @@ -269,7 +286,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget { renderColumn = Math.min(renderColumn, msg.range.startColumn); highlightRange = Range.plusRange(highlightRange, msg.range); - if (!isColorHover(msg)) { + if (!(msg instanceof ColorHover)) { msg.contents .filter(contents => !!contents) .forEach(contents => { diff --git a/src/vs/editor/contrib/hover/common/hover.ts b/src/vs/editor/contrib/hover/common/hover.ts index 30d98a7fa5b..5bd3f3eb71d 100644 --- a/src/vs/editor/contrib/hover/common/hover.ts +++ b/src/vs/editor/contrib/hover/common/hover.ts @@ -10,14 +10,10 @@ import { onUnexpectedExternalError } from 'vs/base/common/errors'; import { TPromise } from 'vs/base/common/winjs.base'; import { IReadOnlyModel } from 'vs/editor/common/editorCommon'; import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; -import { Hover, HoverProviderRegistry, ColorHover } from 'vs/editor/common/modes'; +import { Hover, HoverProviderRegistry } from 'vs/editor/common/modes'; import { asWinJsPromise } from 'vs/base/common/async'; import { Position } from 'vs/editor/common/core/position'; -export function isColorHover(hover: Hover): hover is ColorHover { - return !!(hover as any).color; -} - export function getHover(model: IReadOnlyModel, position: Position): TPromise { const supports = HoverProviderRegistry.ordered(model); @@ -29,7 +25,7 @@ export function getHover(model: IReadOnlyModel, position: Position): TPromise { if (result) { let hasRange = (typeof result.range !== 'undefined'); - let hasHtmlContent = !isColorHover(result) && (typeof result.contents !== 'undefined' && result.contents && result.contents.length > 0); + let hasHtmlContent = typeof result.contents !== 'undefined' && result.contents && result.contents.length > 0; if (hasRange && hasHtmlContent) { values[idx] = result; } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index abbd6316a31..d7d5e3f08dd 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1121,17 +1121,6 @@ declare module monaco.editor { position: OverviewRulerLane; } - export type IColorFormat = string | { - opaque: string; - transparent: string; - }; - - export interface IColorInfo { - color: Color; - format: IColorFormat; - availableFormats: IColorFormat[]; - } - /** * Options for a model decoration. */ @@ -1153,10 +1142,6 @@ declare module monaco.editor { * Array of MarkedString to render as the decoration message. */ hoverMessage?: MarkedString | MarkedString[]; - /** - * Color with mode to render in the color picker. - */ - colorInfo?: IColorInfo; /** * Should the decoration expand to encompass a whole line. */ @@ -4437,7 +4422,7 @@ declare module monaco.languages { * A hover represents additional information for a symbol or word. Hovers are * rendered in a tooltip-like widget. */ - export interface MarkedStringHover { + export interface Hover { /** * The contents of this hover. */ @@ -4450,20 +4435,6 @@ declare module monaco.languages { range: IRange; } - export interface ColorHover { - color: Color; - format: IColorFormat; - availableFormats: IColorFormat[]; - /** - * The range to which this hover applies. When missing, the - * editor will use the range at the current position or the - * current position itself. - */ - range: IRange; - } - - export type Hover = MarkedStringHover | ColorHover; - /** * The hover provider interface defines the contract between extensions and * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature. diff --git a/src/vs/workbench/api/node/extHostTypeConverters.ts b/src/vs/workbench/api/node/extHostTypeConverters.ts index 182ca0eb016..61de4a98d1d 100644 --- a/src/vs/workbench/api/node/extHostTypeConverters.ts +++ b/src/vs/workbench/api/node/extHostTypeConverters.ts @@ -16,7 +16,7 @@ import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles'; import { IPosition } from 'vs/editor/common/core/position'; import { IRange } from 'vs/editor/common/core/range'; import { ISelection } from 'vs/editor/common/core/selection'; -import { IColorInfo } from "vs/workbench/api/node/extHost.protocol"; +import { IColorInfo } from 'vs/workbench/api/node/extHost.protocol'; export interface PositionLike { line: number; @@ -254,14 +254,14 @@ export const location = { } }; -export function fromHover(hover: vscode.Hover): modes.MarkedStringHover { - return { +export function fromHover(hover: vscode.Hover): modes.Hover { + return { range: fromRange(hover.range), contents: hover.contents }; } -export function toHover(info: modes.MarkedStringHover): types.Hover { +export function toHover(info: modes.Hover): types.Hover { return new types.Hover(info.contents, toRange(info.range)); } diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index f35abf69b1f..fed577004d3 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -26,7 +26,7 @@ import { IHeapService } from 'vs/workbench/api/electron-browser/mainThreadHeapSe import { ExtHostDocuments } from 'vs/workbench/api/node/extHostDocuments'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors'; import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/common/quickOpen'; -import { DocumentSymbolProviderRegistry, DocumentHighlightKind, MarkedStringHover } from 'vs/editor/common/modes'; +import { DocumentSymbolProviderRegistry, DocumentHighlightKind, Hover } from 'vs/editor/common/modes'; import { getCodeLensData } from 'vs/editor/contrib/codelens/browser/codelens'; import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition } from 'vs/editor/contrib/goToDeclaration/browser/goToDeclaration'; import { getHover } from 'vs/editor/contrib/hover/common/hover'; @@ -440,7 +440,7 @@ suite('ExtHostLanguageFeatures', function () { return threadService.sync().then(() => { return getHover(model, new EditorPosition(1, 1)).then(value => { assert.equal(value.length, 2); - let [first, second] = value as MarkedStringHover[]; + let [first, second] = value as Hover[]; assert.equal(first.contents[0], 'registered second'); assert.equal(second.contents[0], 'registered first'); }); -- GitLab