Search code examples
visual-studio-codeintellisensedefinitelytyped

Getting intellisense in VSCode


I'm trying to get intellisense into my visual studio code install, for various libraries.

I installed typings (https://github.com/typings/typings) in an attempt to make it easier.

Now, I have managed (with typings) to install both jquery.d.ts and bootstrap.d.ts, which I think is the right approach.

However, I still don't have any intellisense on either.

To avoid having to add /// references to all my files, I added the files in my jsconfig.json file, like so:

"compilerOptions": {
        "target": "es6",
        "files": [
            "typings/bootstrap.d.ts",
            "typings/jquery/jquery.d.ts"
        ]
    }

But no luck.

Most of my googling finds TSD as the tool for this, which is deprecated and points to typings instead. But it only really seems to get the files for me, not include them into my project.

Help! What do I do, to get the intellisense for these libraries, into my editor?


Solution

  • This is what your jsconfig.json should look like:

    {
      "compilerOptions": {
        "target": "ES6",
        "allowSyntheticDefaultImports": true
      },
      "exclude": [
        "node_modules"
      ]
    }
    

    The .ts files are included automatically by VS Code.