Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed May 5, 2022
1 parent 3b08d52 commit 084ccab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
},
registerInlineCompletionItemProvider(selector: vscode.DocumentSelector, provider: vscode.InlineCompletionItemProvider): vscode.Disposable {
checkProposedApiEnabled(extension, 'inlineCompletions');
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!`);
if (provider.handleDidShowCompletionItem) {
checkProposedApiEnabled(extension, 'inlineCompletionsAdditions');
}
return extHostLanguageFeatures.registerInlineCompletionsProvider(extension, checkSelector(selector), provider);
},
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/common/extHostLanguageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
}

const normalizedResult = isArray(result) ? result : result.items;
const commands = isArray(result) ? [] : result.commands || [];
const commands = this.isAdditionProposedApiEnabled ? isArray(result) ? [] : result.commands || [] : [];

let disposableStore: DisposableStore | undefined = undefined;
const pid = this._references.createReferenceId({
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/api/common/extHostTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,7 @@ export class CompletionList {
@es5ClassCompat
export class InlineSuggestion implements vscode.InlineCompletionItem {

filterText?: string;
insertText: string;
range?: Range;
command?: vscode.Command;
Expand Down

0 comments on commit 084ccab

Please sign in to comment.