简体   繁体   English

如何在 VS Code 中为 JS 文件禁用 dot emmet intellisense

[英]How to disable dot emmet intellisense for JS files in VS Code

I want to use emmet in a Javascript file that contains JSX code but I don't want IntelliSense to suggest an emmet whenever I use the dot ( . ) operator.我想在包含 JSX 代码的 Javascript 文件中使用 emmet,但我不希望 IntelliSense 在我使用点 ( . ) 运算符时建议使用 emmet。

For example, I don't want the .rap emmet suggestion to show up:例如,我不希望出现.rap emmet 建议:

图片

I tried these settings:我尝试了这些设置:

"emmet.showSuggestionsAsSnippets": true,
"editor.snippetSuggestions": "bottom",

However, I get another problem:但是,我遇到了另一个问题:

这个问题

Replacing "editor.snippetSuggestions" from "bottom" to "inline" also doesn't help."editor.snippetSuggestions""bottom"替换为"inline"也无济于事。

The way i use emmet is, I have set a hotkey for emmet exapansion as ctrl+e and use that to expand in js/ts files.我使用 emmet 的方式是,我将emmet 扩展热键设置为ctrl+e并使用它来扩展 js/ts 文件。

And set emmet's settings like that -并像这样设置 emmet 的设置 -

"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly"

as, this will not show emmet abbreviation(intellisense) in other than css and html files, and thus don't clutter other intellisense in js and ts files.因为,这不会在 css 和 html 文件中显示 emmet 缩写(智能感知),因此不会在 js 和 ts 文件中混淆其他智能感知。

Thanks.谢谢。

To disable emmet (that 'dot snippet' in your screenshot is one of the things emmet does) in javascript/react files you could try adding this to your settings.json file:要在 javascript/react 文件中禁用 emmet(屏幕截图中的“点片段”是 emmet 所做的事情之一),您可以尝试将其添加到您的 settings.json 文件中:

"emmet.excludeLanguages": [
        "javascriptreact",
        "javascript"
    ]

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

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