-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed as not planned
Closed as not planned
Copy link
Labels
7.0 LS MigrationBugA bug in TypeScriptA bug in TypeScriptDomain: LS: TSServerIssues related to the TSServerIssues related to the TSServerVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
Copied from microsoft/vscode#12547
Reported by @nomaed
- VSCode Version: 1.5.3 (5be4091987a98e3870d89d630eb87be6d9bafd27)
- OS Version: macOS Sierra 10.12
Steps to Reproduce:
- Create an empty directory
- Run
npm initand thennpm i --save-dev typescript - Run
tsc --init(or./node_modules/.bin/tsc --init) - Create
test.tsand add code that's usingMapandSet:
const foo = new Map();
const bar = new Set();- Edit
tsconfig.json, settargetto bees2015, and addfilessection with the test script (test) without its extension:
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"noImplicitAny": false,
"sourceMap": false
},
"files": [ "test" ]
}- Run
tsc(or./node_modules/.bin/tsc), see thattest.jsis created with exactly the same code, as expected, and no warnings or errors have been seen.
At this point, tsc compiled the file test while adding the default .ts extension when resolving.
Now adding VSCode into the picture:
- Run
code .to open VSCode with the current testing directory loaded. Either that, or from GUI go toFiles > Openand loaded the current directory. - Open
test.tsfile. At this point VSCode may ask about TypeScript version, if TypeScript 2.0 was installed by npm. It doesn't matter whether you choose TS 2.0 or TS 1.8, both produce the same behavior. - Observe
MapandSetbeing unrecognized:

The observed behavior is inconsistent with tsc.
Now, to "fix" it:
- Open
tsconfig.jsonand change thefilessection to have the full file-name with its extensiontest.ts. - Reload TypeScript project or reload VSCode, and open
test.ts. Everything is fine now.

However, I would expect vscode behavior in this to be the same as of tsc.
Metadata
Metadata
Assignees
Labels
7.0 LS MigrationBugA bug in TypeScriptA bug in TypeScriptDomain: LS: TSServerIssues related to the TSServerIssues related to the TSServerVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue