【问题标题】:Visual studio code "files.exclude" not workingVisual Studio 代码“files.exclude”不起作用
【发布时间】:2016-09-15 17:36:39
【问题描述】:

昨天我在 Visual Studio 代码中的用户设置中添加了 files.exclude 以隐藏 .js 和 .map 文件,它工作正常。但是今天(并且没有重新启动或关闭代码)它停止了工作。

这是完整的 settings.json 文件

// Place your settings in this file to overwrite the default settings
{
    "files.exclude": {
        "app/*.js": true,
        "app/*.map": true
    }
}

有人知道如何解决这个问题吗?

【问题讨论】:

  • 你能添加你的项目结构吗?您是在 app 文件夹中看到地图文件还是在某个深层文件夹中看到地图文件?
  • 这是angular 2教程,我认为唯一的地图文件在那个文件夹中......我可以在node_modules文件夹中看到js文件

标签: angularjs typescript visual-studio-code


【解决方案1】:

我通过在每个排除之前添加“**/”来使其工作,我可能以不同的方式打开了项目并且没有注意到父文件夹已添加到项目结构中

【讨论】:

  • 您可能需要app/**/*.js,这意味着app 文件夹下的所有.js 文件(递归)。 **/app/*.js 表示所有 .js 文件任何名为 app 的文件夹。
【解决方案2】:

您可能已经得到答案,但考虑发布,因为这可能是其他人的解决方案。下面对我有用。

"**/app/*.js": {"when": "$(basename).ts"} or

"**/app/**/*.js": {"when": "$(basename).ts"}

【讨论】:

    【解决方案3】:

    我正在运行 VSCode 1.47.3(2020 年),这适用于 typescript。

    "files.exclude": {
      "**/*.js": { "when": "$(basename).ts" }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-11
      • 1970-01-01
      • 2019-06-23
      • 2017-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多