简体   繁体   中英

VSCode extension variable name autocomplete

I am using the autocomplete example from here using JavaScript (small changes from TS to JS) and it works, but it completely replaces the default intellisense suggestions. By default it suggests words that have previously been typed.

My question is, can I either access variable names from within my extension to suggest them myself or somehow allow both my extension and the default suggestions to work?

First, regarding access to variable names, you have no access to information about the document structure or completion items generated outside your extension. You would have to parse the document and generate according completion items yourself.

Second, regarding default suggestions, see the answer to this question: add completionitemprovider and keep suggestions .

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