简体   繁体   English

VSCode 扩展变量名称自动完成

[英]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.我正在使用此处使用 JavaScript 的自动完成示例(从 TS 到 JS 的小改动)并且它有效,但它完全取代了默认的智能感知建议。 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 .其次,关于默认建议,参见这个问题的答案: 添加完成项提供者并保留建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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