Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode: add support for inline completions #11901

Merged
merged 1 commit into from
Dec 6, 2022

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 👍

packages/plugin-ext/src/plugin/types-impl.ts Outdated Show resolved Hide resolved
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 👍

packages/plugin-ext/src/plugin/plugin-context.ts Outdated Show resolved Hide resolved
The commit adds support for the `inline completions` VS Code API.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
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
2 participants