提交 6892cfc9 编写于 作者: J Johannes Rieken

for now remove SelectionRangeKind #67872

上级 d77d8d56
......@@ -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)
};
});
});
......
......@@ -98,7 +98,6 @@ export function activate(context: ExtensionContext) {
return rawSelectionRanges.map(selectionRange => {
return {
range: client.protocol2CodeConverter.asRange(selectionRange.range),
kind: selectionRange.kind
};
});
});
......
......@@ -222,7 +222,6 @@ export function activate(context: ExtensionContext) {
return rawSelectionRanges.map(selectionRange => {
return {
range: client.protocol2CodeConverter.asRange(selectionRange.range),
kind: selectionRange.kind
};
});
});
......
......@@ -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 {
......
......@@ -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,
......
......@@ -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));
}
}
......
......@@ -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;
}
}
......
......@@ -800,8 +800,8 @@ suite('ExtHostLanguageFeatureCommands', function () {
disposables.push(extHost.registerSelectionRangeProvider(nullExtensionDescription, defaultSelector, <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))
]];
}
}));
......
......@@ -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))
]];
}
}));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册