Skip to content
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 and code validator in JavaScript broken #6239

Closed
Sampo123 opened this issue May 10, 2016 · 14 comments
Closed

Intellisense and code validator in JavaScript broken #6239

Sampo123 opened this issue May 10, 2016 · 14 comments
Assignees
Labels
javascript JavaScript support issues

Comments

@Sampo123
Copy link

  • VSCode Version:
    Version 1.0.0
    Commit fa6d0f0
    Date 2016-04-13T14:21:33.326Z
    Shell 0.35.6
    Renderer 45.0.2454.85
    Node 4.1.1
  • OS Version:
    Debian Jessie

Steps to Reproduce:
Reproduction might be an issue as it seems to be severely broken in my project. I have added the jsconfig.json into root of my project and it looks like this:

{
"compilerOptions": {
"target": "ES6",
"module": "commonjs"
},
"exclude": [
"node-modules", "bower_components", "dist"
]
}

Project basically contains some node.js, some react etc.

But, the intellisense and all ide features are just broken. No code correction, no intellisense, not with in the file, for example creating a variable with String initializer, like this:

var a = "aaa";

VS Code is not able to recognize the a as a String. So no proposals what so ever when I try to get them show. Also I can write full non sense where ever I want and there are no error or warning markers what so ever.

Also when I open the VS Code, it will show "Loading..." for a while for things I try to hover but after that, nothing.

Only "intellisense" autocompletion I get is just autocomplete to words I have used in the same file. Words, no variables of nothing like that, just words.

Only thing more I can provide is that when I open the developer tools in the VS Code I get this error (repeatedly):

VSCode-linux-x64/resources/app/out/vs/workbench/workbench.main.js:91
[Extension Host] Object
Command: "projectInfo"
message: "Error processing request. Cannot read property 'projectFilename' of undefined."

It also presents itself in threadService.ts:198

As I have tries Googling this, set the project up tens of times and I'm not able to find any help, I'm starting to think that this is bug. Also what ever happens it probably should not brake like this.

If more information or tests are wanted, please contact me.

@jrieken
Copy link
Member

jrieken commented May 10, 2016

@Sampo123 Is this a typo node-modules since it should be node_modules?

@jrieken jrieken added info-needed Issue requires more information from poster javascript JavaScript support issues labels May 10, 2016
@Sampo123
Copy link
Author

Hey, it might be typo but I do not recall it having much of an effect as I just added some excludes randomly when nothing seemed to work.

Though even if it is the source of my problems, I do not think that the behavior should be like this. As in kind of a silent death without any tool tips or help messages telling me where the problem is?

@jrieken
Copy link
Member

jrieken commented May 11, 2016

I know - tho TypeScript can be confused when some folders are mistyped. Also ,it then might include all JS files in the node_module folder which might be too much for it.

@Sampo123
Copy link
Author

Ok, I changed the exclude path to right path and now it seems to be kind of working. So this is kind of resolved but it might be good idea to try to add some kind of error / help message in these kind of cases.

Also it seems bit curious that I did not find anything from the net with the error message so now there is this "bug report" that might help someone in the future with same kind of typo as me :)

@jrieken
Copy link
Member

jrieken commented May 11, 2016

Totally, agree. We have something in the works that TypeScript reports to us when too many files are encountered - such that it starts crawling... It didn't make it for 1.8.x but will come with the next release. This is where we track the underlying issue: microsoft/TypeScript#7444

@jrieken jrieken removed the info-needed Issue requires more information from poster label May 11, 2016
@jrieken jrieken closed this as completed May 11, 2016
@TedDriggs
Copy link

TedDriggs commented May 27, 2016

I'm now seeing this in my pure-JS project, and I have it correctly configured to exclude node_modules. I can also repro when my only open working folder has one file and no node modules.

screen shot 2016-05-27 at 12 40 27 pm

I see the following warning in the developer console:

"Error processing request. Cannot read property 'projectFilename' of undefined"

@Sampo123
Copy link
Author

@TedDriggs

That is exactly the behavior I got but it got fixed when I excluded the node_modules. Do you have some other folder with some content that could make VS Code have hard time?

@Lichtjaeger
Copy link

I got the same Error.

This is my jsconfig.json:

{
    // See https://go.microsoft.com/fwlink/?LinkId=759670
    // for the documentation about the jsconfig.json format
    "compilerOptions": {
        "target": "es6",
        "module": "commonjs",
        "allowSyntheticDefaultImports": true
    },
    "exclude": [
        "node_modules",
        "bower_components",
        "jspm_packages",
        "tmp",
        "temp"
    ]
}

I'm working on windows on an electron project. So I have a ./node_modules and a ./app/node_modules directory.

What I have to do to make it work.

@Sampo123
Copy link
Author

To my understanding from the other bug that this was linked to:

VS Code gets confused if you have large amount of JS (or TS) files in your project. The node_modules and bower_components are just some most common places.

There can be some other folder, like some temp or something that still gets included and that is why VS Code is confused.

They were working on some improvements but it got pushed to 2.0 if I understood correctly.

@TedDriggs
Copy link

TedDriggs commented May 31, 2016

I've tested this where the only open working folder had exactly 2 files in it: test.js and jsconfig.json. Are there other ways that it could be trying to find files which I need to tell it to exclude? Here's the current body of my jsconfig.json file which is in the root of my project:

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

I also went into Library/Application Support and removed the Code folder to see if any old preferences may be causing this. Issue still repros for me.

@TedDriggs
Copy link

TedDriggs commented Jun 1, 2016

I just tried a similarly clean TypeScript project: No node_modules directory, and only 2 files (both .ts). I saw the console message again and didn't get any Intellisense.

Edit: I previously wasn't seeing the console message, but it's there now.

@TedDriggs
Copy link

Is there anything else I should do to try and fix this, or should I open a new issue?

@evilmachina
Copy link

I am geting this error when running on a case sensitive partition on osx its working fine if I run it on a case insensitive partition.

@jackric
Copy link

jackric commented Sep 2, 2016

I'm also running on a case sensitive partition on osx and getting this problem (like evilmachina above).

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

6 participants