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

ES6 support does not work #95

Closed
AndrewRayCode opened this issue Nov 18, 2015 · 28 comments
Closed

ES6 support does not work #95

AndrewRayCode opened this issue Nov 18, 2015 · 28 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues

Comments

@AndrewRayCode
Copy link

When I open any file in my ES6 Javascript project, every single line is underlined in red, with errors like:

screen shot 2015-11-18 at 12 03 09 pm

In my project's root, I have a jsconfig.json file with the following contents:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs"
    },
    "files": [
        "app/"
    ]
}

The file in question lives inside the app folder.

@AndrewRayCode
Copy link
Author

Furthermore, could you please edit this blog post to make the images of text into actual text? http://blogs.msdn.com/b/vscode/archive/2015/07/06/vs-code-es6.aspx Classic Microsoft :)

@jalipert
Copy link

You need to use the filesGlob property with a wildcard expression if you want to find all *.js files inside of your app folder. Change your jsconfig.json to this:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs"
    },
    "filesGlob": [
        "app/**/*.js"
    ]
}

@AndrewRayCode
Copy link
Author

Where is this documented?

@AndrewRayCode
Copy link
Author

Also this doesn't work. It works if I specify the full path in "files" but with the globbing config my file still shows pure errors.

@jalipert
Copy link

for me, removing the whole "files" section altogether seems to cause the errors to go away, indicating that ES6 applies to the entire project. Not sure if that helps your situation. The filesGlob wasn't actually the fix. (FYI, I got the filesGlob idea from tsconfig.json which is a superset of jsconfig.json, and it seemed to fix the issue, as simply removing the 'files' section fixes it for me... but then you're stuck with ES6 for your whole project)

@AndrewRayCode
Copy link
Author

If my jsconfig.json file is just:

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

It still doesn't work, my file is highlighted as syntax errors. The only thing that's worked so far is specifying the absolute file path.

@AndrewRayCode
Copy link
Author

Also "filesGlob" doesn't autocomplete, only "files", with a strangely bad doc message:

screen shot 2015-11-18 at 1 32 52 pm

making it seem like filesGlob isn't supportd?

@glen-84
Copy link

glen-84 commented Nov 18, 2015

@glen-84
Copy link

glen-84 commented Nov 18, 2015

Duplicate of #54?

@rob3c
Copy link

rob3c commented Nov 19, 2015

filesGlob can be used outside of Atom by using a file watcher with the tsconfig-glob package on npm.

@jacogr
Copy link

jacogr commented Nov 21, 2015

+1 There really is a very weird bug here. When placing the file in the root folder, on some projects, it works, on others it doesn't. Moving the file to the src folder does the trick. I have no resorted to stripping down the jsconfig.json completely... and no go.

{
  "compilerOptions": {
    "target": "ES6"
  }
}

To say the least, this is quite irritating and actually standing in the way on my team using this.

No, we are no going to place a jsconfig.json file in each root source folder, e.g. src/, specs, etc.

@joaomoreno
Copy link
Member

Related to #337

@wcastand
Copy link

I think i found a way arround by putting a exclude instead of files:

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

@jacogr
Copy link

jacogr commented Nov 22, 2015

Only using excludes here, some projects it works, others it doesn't.

Am not using "files" in any of the jsconfig.json project files.

@jrieken jrieken added the javascript JavaScript support issues label Dec 4, 2015
@jrieken
Copy link
Member

jrieken commented Dec 4, 2015

duplicate of #703

@jrieken jrieken closed this as completed Dec 4, 2015
@AndrewRayCode
Copy link
Author

@jrieken my ticket is a dupe of a ticket made 8 days after mine?

@Arebee88
Copy link

Arebee88 commented Dec 4, 2015

Having a garbage experience with typescript and vscode, just give up man. This thread has made up my mind.

@AndrewRayCode
Copy link
Author

Having a garbage experience with typescript and vscode, just give up man. This thread has made up my mind.
@Arebee88

👍 it was crippled from launch, and instead of providing any kind of community support or hiring a community advocate, the devs just keep saying "VS code fully supports ES6." Not documented in any way!

A Microsoft product that has trouble with the filesystem?! Who would have guessed!

@egamma
Copy link
Member

egamma commented Dec 7, 2015

@delvarworld , sorry, that you had an unhappy experience. We are about to close Issue #703. It wasn't a single issue but there were several issues behind the same symptom (and no, it wasn't a file system issue). The fix will be in the December update (pls see #917).

Not documented in any way!

We are always interested in improving our documentation. Please let us know what you would like to see in the JS documentation: https://code.visualstudio.com/Docs/languages/javascript.

Furthermore, could you please edit this blog post to make the images of text into actual text? >http://blogs.msdn.com/b/vscode/archive/2015/07/06/vs-code-es6.aspx Classic Microsoft :)

I was about to do it, but then there is a link to a repository with full source code at the end,

@AndrewRayCode
Copy link
Author

I was about to do it, but then there is a link to a repository with full source code at the end,

Do you think that when coming across a blog and seeing the block of text one needs embedded in an image, the first thing a developer is going to do is scroll to the end of the blog post looking for an unlabeled, obfuscated link to an unrelated part of a codebase? If you have the ability to do, please edit the blog post (and the documentation) to show text instead of an image. I don't see the point of intentionally making every developer have to scour for an external link they don't know exists, to a repository not obviously related to jsconfig.json, following it, losing context of the blog post, assuming they know exactly where to look for the file in the directory structure, then clicking on it.

Pushback against saving time for every single developer who comes to the blog and documentation because "there is a link" is disheartening. Please think of how newcomers approach your docs and tools.

@AndrewRayCode
Copy link
Author

Please let us know what you would like to see in the JS documentation

Not sure if you're just messing with me now, since you quoted me asking where filesGlob is documented, and linked to a page that doesn't mention filesGlob, then asked me what should be added to the docs.

@egamma
Copy link
Member

egamma commented Dec 7, 2015

Not sure if you're just messing with me now, since you quoted me asking where filesGlob is documented

No messing around, but I was wondering whether 1) you have found the page I mentioned and 2) whether you have read the page. I'm interested since in the doc it is mentioned that:

You can create a JavaScript project by dropping in a jsconfig.json file. It's a subset of tsconfig.json.

The tsconfig.json does not support filesGlob, so neither does the jsconfig.json. filesGlob is an Atom-typescript specific extension , Apologies, that you got pointed into this direction and we didn't correct this immediately.

@rui-ktei
Copy link

rui-ktei commented Apr 9, 2016

Well... apparently I'm not the only one who encountered this issue:
capture
I think I do want to like VS Code but seriously guys... since you announced it, I've been paying attention to it and trying to use it. I do want to love it as it has much faster loading speed than Atom, considering they are both based on Electron.

However, sadly, you guys just keep disappointing me. I just installed the latest insider version and the screenshot is what I got. So what's the problem? They're valid JS syntax... rest parameters? arrow functions? This is year 2016 and VS Code still says they're invalid...?!

It's a bit funny that MS always sucks at these front-end development things, always left behind by open source community... Now you guys open sourced but you can't even do this thing right... Such a disappointment... I mean why would I use VS Code instead of Sublime which never gives me these sort of problems... If you want your VS Code to shine, then make it functional first please.

Don't bother giving me jsconfig.json suggestion. I tried, it doesn't work AT ALL. And don't ask me to use TypeScript.

Oh, and see how it looks in Sublime and hopefully you can realize how bad you're at the moment.
capture

@egamma
Copy link
Member

egamma commented Apr 11, 2016

They're valid JS syntax... rest parameters?

@rui-infotrack your snippet is using Rest Spread Properties, which are not part of ES6 and therefore this construct is not yet supported. Please refer to microsoft/TypeScript#2103 for background and check this comment microsoft/TypeScript#2103 (comment).

To get the sublime behaviour you can disable diagnostics using the javascript.validate.enable: false setting. This setting is available in the insiders channel (release notes).

The recommendation is to use eslint together with the vscode-eslint extension to get validation, pls see this documentation.

@ktei
Copy link

ktei commented Apr 17, 2016

@egamma, thank you for the help. I will give it a try. And sorry for my bad attitude

@rui-ktei
Copy link

@egamma Just want to say thank you. I tried and it worked well. With ESLint plugin, it works smoothly! I will try VS Code for some time and see how it goes.

@egamma
Copy link
Member

egamma commented Apr 17, 2016

@rui-infotrack your welcome. I hope you now become a happy Code user 😄

@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 29, 2016
@joma74
Copy link

joma74 commented Jul 17, 2017

Observing/sharing following things on VS code 1.14.1 Linux(as well as before).

  1. Code completion of tsc target values in jsconfig.json seem not in line with the typescript doc https://www.typescriptlang.org/docs/handbook/compiler-options.html and aformentioned vs code docus.

To the effect that inline d.ts library definitions are not found/proposed, if i manually specify a tsc target value of "es6".
If i specify a tsc target value of "ES6" as per the typescript doc, d.ts library definitions are found and proposed. But jsconfig.json get's twiggled.

  1. Code completion of tsc lib values in jsconfig.json seem not in line with the typescript doc https://www.typescriptlang.org/docs/handbook/compiler-options.html.

To the effect that inline tsc lib values in jsconfig.json are twiggled if not lowercased.

  1. Hovering description tsc target values in jsconfig.json does not contain the value "es6".

  2. Changes in jsconfig.json HAVE TO be followed by a restart of VS code. To take proper effect.

  3. With tsc target ES6, intellisense twiggles Promise to be '[js] Type 'Promise' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.'

   ...
   * @return {Promise<void>} as defined async
   */
  static async describeTestBy(description, story, severity, webdriverConfig) {
  ...

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests