So say I have C Intellisense and I also want to deploy my own autocomplete extension, that would provide a small autocomplete functionality based on different conditions.
My question is would my autocomplete extension work by extending the C Intellisense or by replacing it and becoming the only autocomplete extension? If the answer is latter then what are my Options?
C Intellisense is just an example that I would have to deal in my project, it can be any other small autocomplete extension that works on the same .cpp file.
I have tried to perform a similar experiment using the vscode-extension-sample of autocomplete on PlainText file. Where just writing a Lorem Ipsum before trying the Extension Sample and then just writing any single word from Lorem Ipsum does not autocomplete. It is possible that this is not a good example, because as much I am aware there are no Intellisense for plaintext and VSCode may be using it's own built in auto-complete features that are overridden in case of plaintext.
Also the Activation Event was onStartup *
because of other features in my trial extension.
CodePudding user response:
So inorder to make sure that both intellisense and autocomplete work together in your extension, you have to use registerCompletionItemProvider
, but where you will put DocumentSelector
as *
.
This is because if you put a specific stuff like {language: "cpp"}
, the match score is of 10, higher than intellisense and if you are always returning some result, then no way Intellisense will work in parallel, so it also opens possibility of providing specific result.
Source: