Skip to content

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

Closed

Description

From Mel (@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

Activity

  1. waderyan commented on Oct 14, 2016

    @waderyan
    Author

    From Mel (@m3l7) on October 13, 2016 11:27

    the same happens with Promise

  2. waderyan commented on Oct 14, 2016

    @waderyan
    Author

    Mel (@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

  3. mhegazy commented on Oct 15, 2016

    @mhegazy
    Contributor

    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": []
  4. mhegazy commented on Oct 15, 2016

    @mhegazy
    Contributor

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

  5. zontafil commented on Oct 31, 2016

    @zontafil

    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

  6. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    VS Code TrackedThere is a VS Code equivalent to this issueWorking as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions