-
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
JavaScript Intellisense not working for commonJS after upgrading to 0.10.10 #3791
Comments
I have the same issue, intellisense seems to be completely missing as of 0.10.10 in javascript files. I tried introducing a skeleton jsconfig.json file: { This doesn't help. I'm also using typings from tsd. For reference, I tried the exact same setup but changed my file to .ts and tsconfig.json and intellisense worked properly as before the update. |
My issue seems to be related to this as well. |
I have same problem. Javascript intellisense stopped working after update in HTML files. In javascript files it's working fine |
@konrad147 Yours is expected behavior. From the patch notes: |
Sorry, but this is a know limitation that is documented in release notes. We will work with the TypeScript team to bring this back. |
@sghung this works for me, pls see below. Do you have a |
@Daynil do you have a setup that allows me to reproduce the problem. |
I have a similar problem with Javascript after updating to 0.10.10. After update it completely stopped working, forcing Intellisense to show up with ctrl+space shows "Loading..." tooltip which hangs forever. Once I got a tooltip that "[Javascript service?] crashed 5 times in 5 minutes" (are those crash reports logged somewhere so I could share them?) Some details that maybe could be useful for establishing pattern: Update 2: OK, I am pretty sure that I correlated the issue with VS Code trying to parse and cache existing JS folders. My folder structure looks like this:
Opening this folder does crash Intellisense for JS files. It can be fixed with one of few ways:
To see what happens when Intellisense is broken we can observe child processes it spawns. One of child processes will try to cache files from folders I mentioned above, crash silently, new one will be spawned and so on. After few crashes VS Code will show message I mentioned before. One thing I can't figure out to create a repro is why for some projects VS Code will cache Update 1: Changing Old post:
Making it identical to what @egamma suggested did not solve the problem. I tried to open only small part of the project and it still hangs (by opening a folder -> pointing it to some subdirectory with 2-3 *.js files; maybe VS Code is smart enough to look up in directory tree to "base directory"?) The project I have problem with is of rather small (around 50 js files, many of them very short) we are using AngularJS 1.5 with jspm (systemjs) and pure ES6, no TS (no tsd/typings folders are present). Our setup is maybe somewhat unusual as we are using ES6 modules to do heavy lifting when defining Angular components, something like this:
I will try to duplicate my project layout and see if I can get a minimal repro. |
I also am having problems with the intellisense now, getting that ~10s lag. It seems to happen intermittently, but it consistently happens when typing "try" or "trycatch" to get the snippet. The lag ranges from ~3-10s. I tried this in a new file in a new folder, and the lag doesn't occur. Only in my actual project. |
@egamma I added the jsconfig.json as you had suggested. That did not fix the issue. However, if I restart VS Code, then intellisense works again. Are the jsconfig.json properties being cached somehow? (that would be fixed on a restart?) |
OK, can you confirm that you didn't have a jsconfig.json when Intellisense didn't work?
yes, but you do not have to restart you can execute |
@Ravadre please notice that the Something like {
"compilerOptions": {
"module": "commonjs",
"target": "ES6"
},
"exclude": [
"node_modules",
"jspm_packages",
"client/jspm_packages
]
} |
@egamma Yes, I can confirm that I did not have a jsconfig.json file in my workspace (in VS Code 0.10.8, I didn't need a jsconfig.json for intellisense to work). Thanks for the tip regarding Reload JavaScript Project, that worked. Now to workaround this issue I do:
|
@egamma Migration section, which for some reason I missed when I read changelog yesterday explains a lot. It also perfectly explains why removing jsconfig helped. I guess most time I spent on testing was futile 😞 . Possibly, one thing I think could be useful to add would be some sort of a message to inform user that TS engine crashes because of (possibly?) running out of memory. Right now forgetting to exclude 1-2 jspm/node directories can mean that Code will constantly parse those file in the background (which means high IO, allocating lots of memory) over and over again. Thanks for help! |
Here's how my setup looks when I'm getting the issue, with the jsconfig.json set up as directed by @egamma : |
@bill-mybiz your behaviour can be explained by not excluding folders in the jsconfig.json pls see this comment #3791 (comment). |
@egamma This is a TypeScript project and there are no source js files in my ts files glob. But just for the fun of it, I added a jsconfig.json as follows in the root directory (alongside my tsconfig):
I tried both restart javascript project command and restarting vs code itself and there is no difference. There are still several seconds of lag with the trycatch snippet option (as well as with other ctrl+shift+spacebar intellisense). When I hit ctrl+space on "trycatch" to get the snippet intellisense option, it will consistently lag about 10sec. Ctrl+space thereafter will be immediate as long as I don't edit anything. But if I hit spacebar just after trycatch (to move the cursor off of the symbol), then left arrow (to return to the end of "trycatch"), and then ctrl+space, there will be the 10 second lag again. I also tried to explicitly exclude folders in tsconfig, but it is not allowed when using the files glob. My project is available on GitHub here. |
@bill-mybiz since this is a TypeScript project then your issue is unrelated to what is discussed here and you are in the wrong issue 😄
I see that you are using filesGlob this attribute is not supported in TS version that is used by VS Code (fileGlob is an Atom TypeScript specific extension). I would recommend to not use files glob but have a tsconfig.json that has no |
@egamma Ah, yes it's always difficult to decide new issue vs. old one. I just saw that there are so many intellisense issues already and that they seemed to be swallowed by this one. I'll post a new one. Thanks! |
@bill-mybiz thanks, then I'll close this one |
@egamma I think I finally figured out what was going wrong with my project. I had a user setting that pointed to my global the tsserver in node_modules/typescript/lib. Suddenly an error message popped up saying the path doesn't point to a valid tsserver install. When I removed the user setting it started working again. Just in case anyone has this issue. |
@Daynil thanks added this to the release notes about javascript: |
I updated to 0.10.10 today, hoping to try out the new JavaScript support with Salsa. Unfortunately, my Intellisense has stopped working. I am using type definition files from definitely typed (e.g. the express.d.ts).
For example, using 0.10.8:
var exp = require("express");
exp.Router
I will see the content assist for the "Router" function and I can visit the definition file by right clicking on "Router" > Go to Definition
Now when I do the same thing in 0.10.10, I don't see "Router" in the Intellisense list. In addition, the list seems to have variables I had defined earlier in my code (which doesn't apply to express at all).
The text was updated successfully, but these errors were encountered: