diff --git a/extensions/css-language-features/client/src/cssMain.ts b/extensions/css-language-features/client/src/cssMain.ts index 641d11f335b22..a7c4fac148d7a 100644 --- a/extensions/css-language-features/client/src/cssMain.ts +++ b/extensions/css-language-features/client/src/cssMain.ts @@ -88,8 +88,7 @@ export function activate(context: ExtensionContext) { return rawResult.map(rawSelectionRanges => { return rawSelectionRanges.map(selectionRange => { return { - range: client.protocol2CodeConverter.asRange(selectionRange.range), - kind: selectionRange.kind + range: client.protocol2CodeConverter.asRange(selectionRange.range) }; }); }); diff --git a/extensions/html-language-features/client/src/htmlMain.ts b/extensions/html-language-features/client/src/htmlMain.ts index 27f3ad2d6263a..efbfd2b319565 100644 --- a/extensions/html-language-features/client/src/htmlMain.ts +++ b/extensions/html-language-features/client/src/htmlMain.ts @@ -98,7 +98,6 @@ export function activate(context: ExtensionContext) { return rawSelectionRanges.map(selectionRange => { return { range: client.protocol2CodeConverter.asRange(selectionRange.range), - kind: selectionRange.kind }; }); }); diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index ee52e73fc61d5..a553200443144 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -222,7 +222,6 @@ export function activate(context: ExtensionContext) { return rawSelectionRanges.map(selectionRange => { return { range: client.protocol2CodeConverter.asRange(selectionRange.range), - kind: selectionRange.kind }; }); }); diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 014274386ce1b..9b91f35509047 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -84,36 +84,9 @@ declare module 'vscode' { //#region Joh - selection range provider - export class SelectionRangeKind { - - /** - * Empty Kind. - */ - static readonly Empty: SelectionRangeKind; - - /** - * The statement kind, its value is `statement`, possible extensions can be - * `statement.if` etc - */ - static readonly Statement: SelectionRangeKind; - - /** - * The declaration kind, its value is `declaration`, possible extensions can be - * `declaration.function`, `declaration.class` etc. - */ - static readonly Declaration: SelectionRangeKind; - - readonly value: string; - - private constructor(value: string); - - append(value: string): SelectionRangeKind; - } - export class SelectionRange { - kind: SelectionRangeKind; range: Range; - constructor(range: Range, kind: SelectionRangeKind); + constructor(range: Range); } export interface SelectionRangeProvider { diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 274325534264d..9e6f4b3479836 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -800,7 +800,6 @@ export function createApiFactory( ResolvedAuthority: extHostTypes.ResolvedAuthority, Selection: extHostTypes.Selection, SelectionRange: extHostTypes.SelectionRange, - SelectionRangeKind: extHostTypes.SelectionRangeKind, ShellExecution: extHostTypes.ShellExecution, ShellQuoting: extHostTypes.ShellQuoting, SignatureHelpTriggerKind: extHostTypes.SignatureHelpTriggerKind, diff --git a/src/vs/workbench/api/node/extHostTypeConverters.ts b/src/vs/workbench/api/node/extHostTypeConverters.ts index b87947ae0b8b7..793094e713fc8 100644 --- a/src/vs/workbench/api/node/extHostTypeConverters.ts +++ b/src/vs/workbench/api/node/extHostTypeConverters.ts @@ -854,27 +854,17 @@ export namespace Color { } } -export namespace SelectionRangeKind { - - export function from(kind: vscode.SelectionRangeKind): string { - return kind.value; - } - - export function to(value: string): vscode.SelectionRangeKind { - return new types.SelectionRangeKind(value); - } -} export namespace SelectionRange { export function from(obj: vscode.SelectionRange): modes.SelectionRange { return { - kind: SelectionRangeKind.from(obj.kind), + kind: '', range: Range.from(obj.range) }; } export function to(obj: modes.SelectionRange): vscode.SelectionRange { - return new types.SelectionRange(Range.to(obj.range), SelectionRangeKind.to(obj.kind)); + return new types.SelectionRange(Range.to(obj.range)); } } diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index 26d40372a34f8..189cad04375b0 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -1094,35 +1094,13 @@ CodeActionKind.Source = CodeActionKind.Empty.append('source'); CodeActionKind.SourceOrganizeImports = CodeActionKind.Source.append('organizeImports'); CodeActionKind.SourceFixAll = CodeActionKind.Source.append('fixAll'); -@es5ClassCompat -export class SelectionRangeKind { - - private static readonly _sep = '.'; - - static readonly Empty = new SelectionRangeKind(''); - static readonly Statement = SelectionRangeKind.Empty.append('statement'); - static readonly Declaration = SelectionRangeKind.Empty.append('declaration'); - - readonly value: string; - - constructor(value: string) { - this.value = value; - } - - append(value: string): SelectionRangeKind { - return new SelectionRangeKind(this.value ? this.value + SelectionRangeKind._sep + value : value); - } -} - @es5ClassCompat export class SelectionRange { - kind: SelectionRangeKind; range: Range; - constructor(range: Range, kind: SelectionRangeKind, ) { + constructor(range: Range) { this.range = range; - this.kind = kind; } } diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts index f7c066436d539..fa2d483f30aad 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -800,8 +800,8 @@ suite('ExtHostLanguageFeatureCommands', function () { disposables.push(extHost.registerSelectionRangeProvider(nullExtensionDescription, defaultSelector, { provideSelectionRanges() { return [[ - new types.SelectionRange(new types.Range(0, 10, 0, 18), types.SelectionRangeKind.Empty), - new types.SelectionRange(new types.Range(0, 2, 0, 20), types.SelectionRangeKind.Empty) + new types.SelectionRange(new types.Range(0, 10, 0, 18)), + new types.SelectionRange(new types.Range(0, 2, 0, 20)) ]]; } })); 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 5aa4625c2157d..ea15710b13b56 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -1105,8 +1105,8 @@ suite('ExtHostLanguageFeatures', function () { disposables.push(extHost.registerSelectionRangeProvider(defaultExtension, defaultSelector, new class implements vscode.SelectionRangeProvider { provideSelectionRanges() { return [[ - new types.SelectionRange(new types.Range(0, 10, 0, 18), types.SelectionRangeKind.Empty), - new types.SelectionRange(new types.Range(0, 2, 0, 20), types.SelectionRangeKind.Empty) + new types.SelectionRange(new types.Range(0, 10, 0, 18)), + new types.SelectionRange(new types.Range(0, 2, 0, 20)) ]]; } }));