Skip to content

ES6 methods don't work with typescript syntax check #11621

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

Closed
waderyan opened this issue Oct 14, 2016 · 5 comments
Closed

ES6 methods don't work with typescript syntax check #11621

waderyan opened this issue Oct 14, 2016 · 5 comments
Labels
VS Code Tracked There is a VS Code equivalent to this issue Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@waderyan
Copy link

From @m3l7 on October 11, 2016 14:36

  • VSCode Version: 1.6
  • OS Version: fedora 23

my current tsconfig.json is

  {
      "compilerOptions": {
          "target": "es6",
          "module": "commonjs",
          "sourceMap": true,
          "outDir": "src",
          "typeRoots": ["./typings/modules", "./typings/globals"]
      },
      "include":[
          "src/**/*"
      ]
  }

let's say I have this:

  Object.assign({});

if I compile the project with tsc --lib es6 or with a gulp task, it works correctly. However, vscode syntax check gives:

  [ts] Property 'assign' does not exist on type 'ObjectConstructor'

Copied from original issue: microsoft/vscode#13514

@waderyan
Copy link
Author

From @m3l7 on October 13, 2016 11:27

the same happens with Promise

@waderyan waderyan self-assigned this Oct 14, 2016
@waderyan
Copy link
Author

@m3l7 thank you for opening this issue. I have confirmed this happens with the latest bits. This is a language service issue. Moving to that repo.

image

@waderyan waderyan added the VS Code Tracked There is a VS Code equivalent to this issue label Oct 14, 2016
@waderyan waderyan removed their assignment Oct 14, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Oct 15, 2016

The issue here is that the tsconfig.json as listed above includes no files. The include list includes "src", but then the output directory is "src" as well. the compiler does not want to recompile the files it outputted last cycle, so it excludes the output directory by default. so the net results is no files to compile..

To solve this either:

  • use a different outDir
  • Do not set outDir at all, by default a .js file is emitted next to its source .ts file
  • add an empty "exclude": []

@mhegazy mhegazy added the Working as Intended The behavior described is the intended behavior; this is not a bug label Oct 15, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Oct 15, 2016

I have logged #11650 to track showing an error message if the compilation included no files.

@zontafil
Copy link

sorry for the late reply.
not setting an outDir seems to fix. However, setting an outDir different from include array results in the debugger failing to start. (Cannot launch program 'api.ts'; setting the 'outFiles' attribute might help.')
But this seems like a different issue

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
VS Code Tracked There is a VS Code equivalent to this issue Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

3 participants