简体   繁体   中英

Visual studio code “files.exclude” not working

Yesterday I added files.exclude to my user settings in visual studio code to hide .js and .map files and it worked correctly. But today (and without restarting or closing code) it stopped working.

This is the full settings.json file

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

Anyone knows how to fix this?

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

You might have already got the answer but thought of posting as this might be a solution for others. Below worked for me.

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

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

I'm running VSCode 1.47.3 (in 2020) and this works well for typescript.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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