Skip to content

Conversation

@vince-fugnitto
Copy link
Member

@vince-fugnitto vince-fugnitto commented Nov 21, 2022

What it does

Closes: #11868.

The pull-request adds support for the VS Code InlineCompletions related APIs (non-proposed):

inline-completions-api.mp4

How to test

  1. start the application with the following https://github.com/eclipse-theia/theia/files/10059321/inline-completions-0.0.1.zip
  2. open an editor
  3. hello world should be proposed as an inline completion
import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {
    const provider = createInlineCompletionItemProvider();
    vscode.languages.registerInlineCompletionItemProvider({ pattern: '**' }, provider);
}

export function deactivate() { }

function createInlineCompletionItemProvider(): vscode.InlineCompletionItemProvider {
    return {
        provideInlineCompletionItems(document, position, context, token) {
            return [{
                insertText: "hello world",
            }];
        },
    }
}

CQ

Review checklist

Reminder for reviewers

@vince-fugnitto vince-fugnitto added vscode issues related to VSCode compatibility CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) labels Nov 21, 2022
@vince-fugnitto vince-fugnitto marked this pull request as ready for review November 28, 2022 12:36
@vince-fugnitto
Copy link
Member Author

The CQ for the pull-request has been approved 👍

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite good to me. I can confirm that the functionality works as expected with the provided extension and the APIs show as supported in the comparator report.

I have a question regarding naming, see below. Otherwise LGTM 👍

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

The commit adds support for the `inline completions` VS Code API.

Signed-off-by: vince-fugnitto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) vscode issues related to VSCode compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vscode: add support for InlineCompletionItem related APIs

3 participants