-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intellisense for nodejs doesn't work without a jsconfig.json after 0.10.10 #3936
Comments
This may be a simple repro for #3791 |
I got it working again by adding a jsconfig.json to the root with the module attribute set: |
👍 I just ran into this same problem and adding |
This is the underlying issue microsoft/TypeScript#7292, that is, the default of the module type when you have no jsconfig.json was changed by accident, this will be fixed for TS 1.9. For now the work around is to add a jsconfig.json. |
I run into the same problem. After adding jsconfig.json IntelliSense is working. However warnings are not displayed. For example, if we pass a string parameter instead of number as shown in the Node.js walkthrough there is no warning. |
@tonyfi We have decided to deprecate the built-in linting support in favor of existing linters like I've tried to document this in the release notes see the |
@tstringer actually this is by design. When you have no jsconfig.json or tsconfig.json, then each file is treated as an island. The file can have references to other files e.g. using commonjs imports and they will be considered. However, other files in the same folder like the typings folder are not considered since there is no reference to them. You can add a reference to a typings file manually using a /// reference VS Code 0.10.8 used a slightly different semantics. When there was no jsconfig.json then all files inside the workspace where considered to belong to the same project. Now that TypeScript supports hybrid projects of JS and TS files, it is no longer an option to have different project semantics and you now always get the TypeScript semantic. Bottom line you should always add a jsconfig.json to define the project context and its excluded files. This will give you reference searches, Intellisense etc. For March we have added some hinting UI to guide the user to create a jsconfig.json. |
@egamma Thanks so much for the information! Just to clarify, is this no longer considered a bug or accidental-break? And if that's the case, for JavaScript projects/applications going forward, the correct approach would be to create the Likewise, if this is the intended behavior, is this documented? I couldn't find any documentation explaining this prior to my initial comment. Thanks so much in advance for your time!! When I get my head wrapped around the intention and future of this, I'll make an addendum to a blog post I released about this. |
@tstringer correct, this is as designed. Salsa doesn't automatically pick up .d.ts files. In almost all the cases a |
@egamma Perfect! Thanks! I'll go ahead and update my blog post so it doesn't mislead readers into thinking it is "broken" or a "bug". |
I found this going through the /docs/runtimes/Node.js walkthrough after seeing a doc feedback verbatim saying that typings weren't being picked up.
After creating an express application, trying to get IntelliSense for node and express types fails.
If I roll-back to 0.10.8, the typings are picked up correctly.
The generated express app does not include a jsconfig.json file.
The text was updated successfully, but these errors were encountered: