【问题标题】:Find and disable/filter DOM intelliSense recommendations in VS Code在 VS Code 中查找和禁用/过滤 DOM 智能感知建议
【发布时间】:2020-01-14 22:26:47
【问题描述】:

我有一个空白/新的.js 文件。出于某种原因,智能感知/自动完成功能会推荐我不认识也不知道它们来自哪里的东西。有没有办法完全删除这些建议(我永远不需要/使用它们)或如何过滤/排除它们(全局、每个工作空间或扩展)?

这是我开始输入doit时看到的:

如果我选择/添加DocumentTimeline,然后CTRL+点击DocumentTimeline,我看到的就是这个:

我不知道这是怎么来的?我不记得安装任何东西。我不想filter by type,因为在所有类型中都有我想要的有效建议。

【问题讨论】:

  • 您想阻止 Visual Studio 代码提供建议吗?如果是,那么您可以通过在 settings.json 文件“editor.quickSuggestions”中添加以下内容来实现:{“other”:false,“cmets”:false,“strings”:false }
  • 不,我仍然需要建议。我只是不想要这些。

标签: visual-studio-code


【解决方案1】:

您可能希望在您的 jsconfig.json 文件中包含这样的内容:

{
  "compilerOptions": {

      "lib": ["es6", "esnext"]  // or whatever in there, just not "dom"
      // intellisense will show you all the possible entries

   },
      "exclude": [
        "node_modules",
        "**/node_modules/*"
  ],
}

github issue: getting rid of DOM types。我假设lib 选项是您项目的“定义上下文”,并且没有像上面的示例那样限制它,您获得的“上下文”比您希望的要多得多,您将获得dom 选项。

一般见vscode docs on jsconfig

【讨论】:

    猜你喜欢
    • 2022-01-19
    • 1970-01-01
    • 2019-12-08
    • 1970-01-01
    • 2017-06-06
    • 1970-01-01
    • 2017-08-04
    • 2016-02-15
    • 2021-10-09
    相关资源
    最近更新 更多