我正在尝试将 Intelisense 功能添加到 JSDoc 代码块,因此它确实包括代码完成并验证这些块内的语法和类型:
/**
* Ensures that the word starts with capital later
* ```jsx
* console.log( capitalize('hello') ) // Would be cool to have autocompletion here
* console.log( capitalize(42) ) // And to highlight error here
* ```
*/
function capitalize(word: string) {
return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase();
}
关于如何实现它的任何想法,因为我只找到了
registerCompletionItemProvider
,但我看不到使用它来向 JSDoc 添加完成的选项