Home > OS >  how do i configure vscode to use my entire workspace for javsascript code suggestions
how do i configure vscode to use my entire workspace for javsascript code suggestions

Time:09-17

i'm not using anything like vue or react or node. or any other "compiled" javascript library. i was told that there's some sort of configuration to make it so that vscode will use my entire workspace. the linked me to some docs that don't seem to include how to do this.

i've created a jsconfig.json but i'm not really sure what exactly i'm supposed to be putting in it. or where to even look for what setting could possibly do this. i'm already looking at the vscode docs and they don't

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6"
    },
    "include": ["js/**/*"]
}

i feel like this is expecting me to be using some sort of compiled javascript library. i'm basically just using jquery and some simple mvc stuff so i don't have to learn a whole new thing. i'm able to get good code hinting for php without having to use something like cakephp to make everything work.

CodePudding user response:

the jsconfig.json needs to be in the project root. and doesn't need the include.

/jsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6"
    }
}

add this to your project root to get it to find all the js files in your project for nice code hinting.

  • Related