简体   繁体   中英

How to show certain files in Visual Studio Code

I wish to hide .js file & .map file extensions, but to display some .js files that are important to my project. When I use the following to hide:

{
    "files.exclude": {

        "**/*.js": true,
        "**/*.js.map": true
    } 

}

Everything gets hidden. How can I display specific files while the rest are hidden?

You probably want to hide .js files only when there is a .ts file with the same name, so you need to add condition:

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

}

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