Z Smith
Z Smith

Reputation: 252

Project-wide Intellisense in VS Code?

I'm using Visual Studio Code, currently working on a web project using PHP, HTML, CSS, JS. I've found the intellisense features (e.g. auto-completion and go-to definition) useful, particularly in JS. However, it only seems to scan open files, not the entire project to detect variables and functions. Since my code is split among various files with global items, is there any way (via setting or extension) to get it to scan the entire project?

Upvotes: 1

Views: 2253

Answers (1)

Matt Bierner
Matt Bierner

Reputation: 65175

See our JavaScript Docs for help getting started. You likely need to create a jsconfig.json file at the root of your workspace:

{
    "compilerOptions": {
        "target": "ES6"
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}

This tells VSCode to treat all JS files in your workspace (even unopened ones) as part of the same project

Upvotes: 3

Related Questions