如何让SublimeText在folder_include_patterns下显示子目录?

时间:2015-02-11 11:20:58

标签: sublimetext sublimetext3

我有一个SublimeText3项目,我用它来显示侧栏中的特定文件夹。这是有效的,但folder_include_pattern中文件夹的子目录在项目中不可见(如果我将项目作为文件夹打开,它们显然就在那里)。

node_modules
  my-module
    ('test' should be here but is not shown)
  my-other-module
    ('test' should be here but is not shown)

这是我的.project文件:

{
  "folders": [
    {
      "path": "node_modules",
      "folder_include_patterns": [
        "my-module",
        "my-other-module"
      ]
    },
    {
      "path": "."
    }
  ]
}

如何在folder_include_patterns中显示目录的所有子目录?

1 个答案:

答案 0 :(得分:4)

解决了它:子目录名称也必须在folder_include_patterns 。例如,要包含/node_modules/my-module/test,我需要:

 {
  "folders": [
    {
      "path": "node_modules",
      "folder_include_patterns": [
        "my-module",
        "my-other-module",
        "test"
      ]
    },
    {
      "path": "."
    }
  ]
}

2018 updae:请注意,如果您在2018年阅读此内容,并希望为node_modules执行此操作,这是处理monorepos的最佳方式(您拥有自己的模块)包含在项目中)是通过yarn workspaces