Answer a question

I use CTRL+Click (or F12) to search and open the definitions in vscode. The problem is that my files are copied to another directory called sketch as I compile my code, so when I wanna open the definition of a function, VS shows both files (the real and the copied ones in the sketch folder), and sometimes I edit the copied file by mistake!

How can I exclude some folders from the "Go To definition"?

Answers

I had the same problem in a Javascript project. None of the following solved it for me: files.exclude, files.watcherExclude, or search.exclude.

The solution was to add jsconfig.json to my project folder:

{
    "compilerOptions": {
        "target": "ES6"
    },

    "exclude": [
        "Backup",
        "Sketch"
    ]
}

This example specifies two folders to exclude: "Backup", and "Sketch".

If you are using TypeScript, use a tsconfig.json file instead.

Also see https://code.visualstudio.com/docs/languages/jsconfig

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐