How to trigger "inline suggestion" in VSCode?
·
Answer a question
There're two built-in commands for showing "inline suggestion":
editor.action.inlineSuggest.showPreviouseditor.action.inlineSuggest.showNext
I've tried both, but nothing happened, in what circumstance could an inline suggestion be triggered?
Answers
For v1.58, see Inline Suggestions:
Inline Suggestions
The inline suggestions API allows extensions to provide inline suggestions that are decoupled from the suggestion widget. An inline suggestion is rendered as if it was already accepted, but with a gray color. Users can cycle through suggestions and accept them with the
Tabkey.vscode.languages.registerInlineCompletionItemProvider( { pattern: '**' }, { provideInlineCompletionItems: async (document, position) => { return [{ text: '< 2) {\n\treturn 1;\n\t}' }] }, }, )
Demo:

更多推荐
所有评论(0)