[英]Why CompletionItemProvider not work when enter charactor?
I have uploaded my code at https://github.com/Hfutsora/monaco-kaco .我已经在https://github.com/Hfutsora/monaco-kaco上传了我的代码。
Steps to reproduce:重现步骤:
I think the problem is that VS Code filters out your candidates because it gets the wrong already typed
characters.我认为问题是 VS Code 过滤掉了你的候选人,因为它得到了错误的
already typed
的字符。 In my completion providers I use a different method:在我的完成提供者中,我使用了不同的方法:
const info = model.getWordUntilPosition(position);
which finds the word before the current caret position.它会找到当前插入符号 position之前的单词。
CompletionItem.Range Note CompletionItem.Range 注解
The range in CompletionItem must be a SingleLine, I provided a error range with different startLine and endLine, I thought this was the problem. CompletionItem 中的范围必须是 SingleLine,我提供了具有不同 startLine 和 endLine 的错误范围,我认为这是问题所在。
monaco.Range({
position.lineNumber,
word?.startColumn ?? position.column,
model.getLineCount(), // not the same line
model.getLineMaxColumn(model.getLineCount())
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.