如何在VSCode中触发"inline suggestion"?
How to trigger "inline suggestion" in VSCode?
有两个用于显示“内联建议”的内置命令:
editor.action.inlineSuggest.showPrevious
editor.action.inlineSuggest.showNext
我都试过了,但是没有任何反应,在什么情况下可以触发内联建议?
对于 v1.58,请参阅 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 Tab
key.
vscode.languages.registerInlineCompletionItemProvider(
{ pattern: '**' },
{
provideInlineCompletionItems: async (document, position) => {
return [{ text: '< 2) {\n\treturn 1;\n\t}' }]
},
},
)
演示:
有两个用于显示“内联建议”的内置命令:
editor.action.inlineSuggest.showPrevious
editor.action.inlineSuggest.showNext
我都试过了,但是没有任何反应,在什么情况下可以触发内联建议?
对于 v1.58,请参阅 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
Tab
key.vscode.languages.registerInlineCompletionItemProvider( { pattern: '**' }, { provideInlineCompletionItems: async (document, position) => { return [{ text: '< 2) {\n\treturn 1;\n\t}' }] }, }, )
演示: