Skip to content

Inline completion not workingΒ #994

@Pranith12250

Description

@Pranith12250

Extension sample

inline-completions

VS Code version

1.87.2

What went wrong?

I am trying to understand how the inline code completion feature of vs code works and how I can use it in an extension. So, to understand its working, I went and looked at its code sample here.
However, as soon as I open and run the code without making any changes at all, I see the following errors:

Activating extension 'vscode-samples.inline-completion-sample' failed: Extension 'vscode-samples.inline-completion-sample' CANNOT use API proposal: inlineCompletionsAdditions. Its package.json#enabledApiProposals-property declares: but NOT inlineCompletionsAdditions. The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api vscode-samples.inline-completion-sample.

Screenshot 2024-03-23 at 2 37 41 AM

[vscode-samples.inline-completion-sample]: editor/inlineCompletions/actions is a proposed menu identifier. It requires 'package.json#enabledApiProposals: ["inlineCompletionsAdditions"]' and is only available when running out of dev or with the following command line switch: --enable-proposed-api vscode-samples.inline-completion-sample

Screenshot 2024-03-23 at 2 38 12 AM

I try running it regardless to see if it still works and it opens a new window as a playground with the below code:

// Trigger inline completions after each line

// [0,*):// Trigger inline completions in this line, they work!
// Trigger inline completions in this line

// [0,*):console.log(


// [0,*):console.log("foo"
// [0,*):console.log({ label: "("


// [0,*):console.log(`${(1+2}`)

// [0,*):({\n){

// [33,33):lambda x: x.notnull()
notNull = languages.apply();

I try typing in "console" just as they did in the demo gif in the sample code page I linked earlier but I am not getting the inline completion. I am just getting normal completion:

Screenshot 2024-03-23 at 2 24 20 AM

Also, I noticed that gif in the sample code is slightly cropped so I am not fully sure how they activated the inline completion as well. I see this issue having been raised multiple times in the past but I do not see any good solutions to it yet other than using VS Code insiders as pointed out by tamuratak in the discussion repo here.
So, it would be nice if this worked in normal VS Code as well so that I can understand its working better.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions