有没有办法禁用“ MDN 引用智能”弹出窗口(HTML 和 CSS)在 VS 代码?

这是指禁用 这个特征,同时让所有其他代码提示特性处于活动状态。

我非常熟悉 Settings GUI 和 setings.json,并且已经搜索了很多内容,但是似乎没有智能感知/提示/建议配置适用于这个特定的弹出窗口。

Annotated screenshot indicating the popup I wish to disable

27887 次浏览

Found this, in settings.json insert the following. It might turn off more than you wanted, but at least that pop up will be gone.

"editor.hover.enabled": false,

To find settings.json (the right one), open VSCode and push Ctrl+P. Type "settings.json" and make sure you open up the one in AppData (or wherever you installed VSCode in).

When you press Ctrl+P looking for the settings.json file it will show you two of them, Open Default settings.json and Open settings.json. you should paste this:

- "editor.hover.enabled": false,

on the Open settings.json.

The default settings.json is not editable.

  1. Just going to Code -> Preferences -> Settings
  2. Search "editor hover enabled" and disable checkbox.

It looks like it will finally be in v1.52 for html files, see https://github.com/microsoft/vscode/issues/97979 - it is coming to css/scss files as well.

Two new settings:

"html.hover.documentation": false,
"html.hover.references": false,

The references one will disable the MDN Reference link only. The documentation setting all the MDN documentation as well.

"html.hover.documentation": "Show tag and attribute documentation in hover.",
"html.hover.references": "Show references to MDN in hover."

And for v1.54 extending to css, scss and less:

Hovers in CSS/LESS/SCSS and HTML

You can now fine tune the content of hovers in HTML and CSS:

  • Do not show documentation from MDN
  • Do not show the link to the MDN page Use the settings css.hover.documentation and css.hover.references resp the similar settings in html, css, scss and less

from https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_54.md#hovers-in-csslessscss-and-html

Go to File > Preferences > Settings

or

Press Ctrl + ,

Search MDN and you will see 4 check boxes there. uncheck those and you are good to go:

4 check-boxes

In this way, you can still have the hover explanations about certain tags and keywords but only the MDN reference link will be gone:

explanations