There're two built-in commands for showing "inline suggestion":
editor.action.inlineSuggest.showPrevious
editor.action.inlineSuggest.showNext
I've tried both, but nothing happened, in what circumstance could an inline suggestion be triggered?
There're two built-in commands for showing "inline suggestion":
editor.action.inlineSuggest.showPrevious
editor.action.inlineSuggest.showNext
I've tried both, but nothing happened, in what circumstance could an inline suggestion be triggered?
对于 v1.58,请参阅内联建议:
内联建议
内联建议 API 允许扩展提供与建议小部件分离的内联建议。内嵌建议就像已被接受一样呈现,但颜色为灰色。
Tab
用户可以循环浏览建议并使用密钥接受它们。vscode.languages.registerInlineCompletionItemProvider( { pattern: '**' }, { provideInlineCompletionItems: async (document, position) => { return [{ text: '< 2) {\n\treturn 1;\n\t}' }] }, }, )
演示: