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

jsconfig.json sometimes not taken into account #703

Closed
skovmand opened this issue Nov 26, 2015 · 38 comments
Closed

jsconfig.json sometimes not taken into account #703

skovmand opened this issue Nov 26, 2015 · 38 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority javascript JavaScript support issues verified Verification succeeded
Milestone

Comments

@skovmand
Copy link

Hi.

Thanks for your product, I really enjoy using it. However I have one problem:
When using ES6 features, like the arrow functions, I get the message "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".

However I have a jsconfig.json-file in my root (the folder opened in Visual Studio Code), which contains:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs"
    }
}

The weird part is that I get it for some files, and not for others. Even if the files are in the same directory. Right now I have three files in the subdirectory /app/bpm names bpm.js, bpmController.js and enterClick.js. All three are written with ES6-functionality, but I only get the warning and red underlined text for bpm.js.

UPDATE:
I just restarted VS Code, and the red underline disappeared from bpm.js too. It was a new file I had created after the two others, however the red underline only went away after a restart.

@skovmand skovmand changed the title jsconfig.json sometimes not being read. jsconfig.json sometimes not taken into account Nov 26, 2015
@skovmand
Copy link
Author

I just reproduced it again. Made a new directory, and moved a file into it. Everything gets the red underline and the warning "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".

Restart VSCODE and it goes away.

@gerrywastaken
Copy link

I have the same problem except while restarting normally fixes this, in this case it's still no working after a restart for a file called schema.js

@jrieken jrieken self-assigned this Nov 26, 2015
@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues labels Nov 26, 2015
@jaccus
Copy link

jaccus commented Nov 26, 2015

This bug makes VS Code completely unusable for ES6 development since the whole editor is obfuscated with red underlines.

I sometimes manage to get it resolved by editing jsconfig.json (add whitespace, save) but then again, only sometimes.

Sounds quite critical to me?

@warpdesign
Copy link
Contributor

+1
Same problem, had to disable builtin js validation.

@nverba
Copy link

nverba commented Nov 27, 2015

+1 This is driving me mental! Completely random too.

@jrieken
Copy link
Member

jrieken commented Nov 27, 2015

I can reproduce with a simple sample but after a short while (2-3 seconds) it recovers. I guess you guys are dealing with large projects?

@mbarzeev
Copy link

+1
This is very annoying, and as others have mentioned - this is a key feature.

@skovmand
Copy link
Author

@jrieken My project is about 25 .js-files in different subdirectories. The tree is up to 3 directories deep.

@egamma egamma added the important Issue identified as high-priority label Nov 30, 2015
@nrkn
Copy link

nrkn commented Dec 1, 2015

How's this for bizarre - I'm getting this same issue in my project, but only in a handful of files that start with the word 'template', like template-controller.js etc. - however, not with templates.js

The affected files are:

/controllers/template-controller.js
/controllers/template-create-controller.js
/controllers/template-edit-controller.js
/api/template-api.js
/template-engine.js

There are maybe ~100 other .js files where the red underlines don't appear when using ES6 syntax

My colleague had the same issue, but it went away when he restarted VSCode - that doesn't work for me, makes no difference, nor does editing and resaving the jsconfig.json.

@Cirych
Copy link

Cirych commented Dec 1, 2015

On Windows VSCode can see jsconfig.json and work properly. But when open project from network drive, VSCode can't see jsconfig.json and show errors on ES6 code.

I have project on VM centos and map a Windows network drive to projects folder. All right, except ES6 errors.
When I copied project to Windows local folder - everything seems Ok with ES6 speling.

@yevk
Copy link

yevk commented Dec 2, 2015

I'm having the same problem. It happens only on directories that are 4th level or deeper. If I move the file up one directory, the error goes away.

@egamma egamma added this to the Dec 2015 milestone Dec 2, 2015
@appetizermonster
Copy link

+1

@lucdew
Copy link

lucdew commented Dec 3, 2015

+1 I have the same issue and it seems to be random. Sometimes when I restart Visual Studio code it disappears, sometimes not.

@jrieken
Copy link
Member

jrieken commented Dec 3, 2015

We will tackle for Dec

This was referenced Dec 4, 2015
@jrieken
Copy link
Member

jrieken commented Dec 4, 2015

@skovmand For you specific case, can you check if the full path of your files (bpm.js, bpmController.js, ...) contains js, like in /users/me/coding/js-stuff/app/bpm etc? I am asking because I have found an issue if our file event processing loop. It's a little complex but basically when a file is added/deleted we check if that is of interest the JS language service and the check seems flawed

jrieken added a commit that referenced this issue Dec 4, 2015
jrieken added a commit that referenced this issue Dec 4, 2015
fix miss-spelled glob pattern
@jrieken
Copy link
Member

jrieken commented Dec 4, 2015

@nrkn I have a fix for the temp-prefix issue.

@jrieken
Copy link
Member

jrieken commented Dec 4, 2015

@yevk About the 4th level directory. Is it that they either start with temp or contain the string js?

@thoreinstein
Copy link

This also seems to be the case with shebang scripts. A file at ~/project/bin/server with the node shebang header #!/usr/bin/env node is not recognized. As soon as the file name is changed to ~/project/bin/server.js it is fine.

@jrieken
Copy link
Member

jrieken commented Dec 4, 2015

@janders223 Yeah, at that point in time we cannot look into each and every file...

jrieken added a commit that referenced this issue Dec 4, 2015
@jrieken
Copy link
Member

jrieken commented Dec 7, 2015

yeah, I could reproduce and fixed it on master.

jrieken added a commit that referenced this issue Dec 7, 2015
@jrieken
Copy link
Member

jrieken commented Dec 7, 2015

I understood and tackles these tasks

  • files are ignored when path contains js, like foo/bar/js-project/far.js
  • paths are ignored when path-segments start with temp, like foo/bar/templateEngine.js
  • js files in jspm_packages folder flood project
  • problem with exclude patterns
  • [defer] problem with files without ending but shebang

Anyone, please speak up if you don't see your issue(s) addressed by that.

@warpdesign
Copy link
Contributor

@jrieken what about files that contain several dots ? like foo.bar.dialog.js ?

@jrieken
Copy link
Member

jrieken commented Dec 8, 2015

I see that working fine @warpdesign

@jrieken
Copy link
Member

jrieken commented Dec 8, 2015

Closing, the remaining work wrt to shebang and files with an extension will be tackled in #1097.

@dbaeumer
Copy link
Member

@jrieken can you please add steps for verification

@jrieken
Copy link
Member

jrieken commented Dec 16, 2015

@dbaeumer #703 (comment)

@mdpratt
Copy link

mdpratt commented Feb 1, 2016

I'm still having the same issue as @Cirych. When opening a folder over a mapped network drive (in this case opening my Linux folder on Windows). Opening the folder while mapped causes VSCode to show everything as syntax errors. Copying my code over to Windows and then opening VSCode to the new folder causes errors to disappear and for intelliSense to work again.

@lironka
Copy link

lironka commented Feb 27, 2016

I have this error too. I try write ES6 in root site files (etc. wabpack.config.js, test.js) and have red underlined. jsconfig.json - doesn't work!

@StarpTech
Copy link

Same issue. Using jsconfig.json doesn't work. e.g const keyword is red underlined.

@matthiasg
Copy link

Same issue here. In one project it works in another (was a copy of the first) it doesnt. Same content in jsconfig.json. Typings are underlined though.

@mortonprod
Copy link

I also have the same issue using the gulp file from this tutorial:
http://www.mithunvp.com/angular-2-in-asp-net-5-typescript-visual-studio-2015/

The arrow function is the issue. I include the needed jsconfig and nothing? Has anyone solved this yet?

@malte-timmermann
Copy link

I also have the issue the jsconfig.json is not being read.

Tested with Visual Studio Code v1.5.3 and v1.7.0 insider, on Windows x64 (version 1607).

When using Sysinternals process monitor, I see that VC Code is getting some information about jsconfig.json (QueryAllInformationFile), but does NOT read the file (ReadFile).

Log when opening VS Code (with the current project) (reduced to jsconfig.json and my test file)

http://pastebin.com/GTKHPCZC

Log when actually opening jsconfig.json inside VS Code (so something like that should also happen when launching VS Code):

http://pastebin.com/je8Y3p4C

Not reading jsconfig.json unfortunately means that "go to definition" doesn't work for me with my own js files, what hinders me from switching from Netbeans to VS Code :(

I would really appreciate if this issue could be fixed. If you need further information, or my stripped down example, just let me know!

@malte-timmermann
Copy link

I just saw that this bug is closed - will open a new/fresh one...

@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
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority javascript JavaScript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests