简体   繁体   中英

Do multiple Autocomplete Extension extend each other in vscode?

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.

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:

  1. add completionitemprovider and keep suggestions Look at comments.
  2. https://github.com/microsoft/vscode/issues/24464

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM