Adds inlineCompletionsNew and inlineCompletionsAdditions proposed APIs to avoid breaking changes when finalizing inline completions API.

This commit is contained in:
Henning Dieterichs
2022-03-10 11:23:01 +01:00
parent 06b2dd2130
commit 3626e6ab0c
6 changed files with 290 additions and 2 deletions

View File

@@ -495,6 +495,13 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
checkProposedApiEnabled(extension, 'inlineCompletions');
return extHostLanguageFeatures.registerInlineCompletionsProvider(extension, checkSelector(selector), provider);
},
registerInlineCompletionItemProviderNew(selector: vscode.DocumentSelector, provider: vscode.InlineCompletionItemProviderNew): vscode.Disposable {
checkProposedApiEnabled(extension, 'inlineCompletionsNew');
if (provider.handleDidShowCompletionItem && !isProposedApiEnabled(extension, 'inlineCompletionsAdditions')) {
throw new Error(`When the method "handleDidShowCompletionItem" is implemented on a provider, the usage of the proposed api 'inlineCompletionsAdditions' must be declared!`);
}
return extHostLanguageFeatures.registerInlineCompletionsProviderNew(extension, checkSelector(selector), provider);
},
registerDocumentLinkProvider(selector: vscode.DocumentSelector, provider: vscode.DocumentLinkProvider): vscode.Disposable {
return extHostLanguageFeatures.registerDocumentLinkProvider(extension, checkSelector(selector), provider);
},
@@ -1205,6 +1212,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
InlineValueVariableLookup: extHostTypes.InlineValueVariableLookup,
InlineValueEvaluatableExpression: extHostTypes.InlineValueEvaluatableExpression,
InlineCompletionTriggerKind: extHostTypes.InlineCompletionTriggerKind,
InlineCompletionTriggerKindNew: extHostTypes.InlineCompletionTriggerKindNew,
EventEmitter: Emitter,
ExtensionKind: extHostTypes.ExtensionKind,
ExtensionMode: extHostTypes.ExtensionMode,
@@ -1218,7 +1226,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
FoldingRangeKind: extHostTypes.FoldingRangeKind,
FunctionBreakpoint: extHostTypes.FunctionBreakpoint,
InlineCompletionItem: extHostTypes.InlineSuggestion,
InlineCompletionItemNew: extHostTypes.InlineSuggestionNew,
InlineCompletionList: extHostTypes.InlineSuggestions,
InlineCompletionListNew: extHostTypes.InlineSuggestionsNew,
Hover: extHostTypes.Hover,
IndentAction: languageConfiguration.IndentAction,
Location: extHostTypes.Location,