'Visual Studio Code and jsconfig.json
I see in Visual Studio Code 0.5.0 that the /// <reference path="../typings/jquery/jquery.d.ts"/>
can be removed from the .js files and added into an overriding jsconfig.json file. I have therefore dropped the jsconfig.json file into the root directory of my project.
However, when I create the file jsconfig.json and add a line referring to the above path to the jquery.d.ts file and remove the /// <reference path .... from my .js files, I am not seeing the intellisense return. As I would expect it to with Visual Studio Code.
The jsconfig.json file I had created was:
{
"files": [
"../typings/jquery/jquery.d.ts"
]
}
Maybe I am missing the point of the jsconfig.json file.
Solution 1:[1]
You don't need to add "files" to your jsconfig.json file. The only reason you need to do that is if you want a specific set.
Instead, remove the files array. It sounds like it still won't work at that point based on your description. My assumption then is you do not have the .\typings\tsd.d.ts" file. It seems to read that to references the correct files. In order to get that, you need to do "tsd install node --save".
Solution 2:[2]
You need to adjust your file paths relative to jsconfig.js.
I.e. define files like:
{
"files": [
"typings/jquery/jquery.d.ts"
]
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Peter Mortensen |
Solution 2 | iaarnio |