diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index a438b79f332..e5ca7469fb0 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -1024,7 +1024,13 @@ class SuggestAdapter { } } -class InlineCompletionAdapter { +class InlineCompletionAdapterBase { + public async provideInlineCompletions(resource: URI, position: IPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise { + return undefined; + } +} + +class InlineCompletionAdapter extends InlineCompletionAdapterBase { private readonly _cache = new Cache('InlineCompletionItem'); private readonly _disposables = new Map(); @@ -1032,9 +1038,11 @@ class InlineCompletionAdapter { private readonly _documents: ExtHostDocuments, private readonly _provider: vscode.InlineCompletionItemProvider, private readonly _commands: CommandsConverter, - ) { } + ) { + super(); + } - public async provideInlineCompletions(resource: URI, position: IPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise { + public override async provideInlineCompletions(resource: URI, position: IPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise { const doc = this._documents.getDocument(resource); const pos = typeConvert.Position.to(position); @@ -1113,7 +1121,7 @@ class InlineCompletionAdapter { } } -class InlineCompletionAdapterNew { +class InlineCompletionAdapterNew extends InlineCompletionAdapterBase { private readonly _cache = new Cache('InlineCompletionItemNew'); private readonly _disposables = new Map(); @@ -1124,14 +1132,16 @@ class InlineCompletionAdapterNew { private readonly _documents: ExtHostDocuments, private readonly _provider: vscode.InlineCompletionItemProviderNew, private readonly _commands: CommandsConverter, - ) { } + ) { + super(); + } private readonly languageTriggerKindToVSCodeTriggerKind: Record = { [languages.InlineCompletionTriggerKind.Automatic]: InlineCompletionTriggerKindNew.Automatic, [languages.InlineCompletionTriggerKind.Explicit]: InlineCompletionTriggerKindNew.Invoke, }; - public async provideInlineCompletions(resource: URI, position: IPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise { + public override async provideInlineCompletions(resource: URI, position: IPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise { const doc = this._documents.getDocument(resource); const pos = typeConvert.Position.to(position); @@ -2156,7 +2166,7 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF } $provideInlineCompletions(handle: number, resource: UriComponents, position: IPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise { - return this._withAdapter(handle, InlineCompletionAdapter, adapter => adapter.provideInlineCompletions(URI.revive(resource), position, context, token), undefined, token); + return this._withAdapter(handle, InlineCompletionAdapterBase, adapter => adapter.provideInlineCompletions(URI.revive(resource), position, context, token), undefined, token); } $handleInlineCompletionDidShow(handle: number, pid: number, idx: number): void {