_From @screendriver on August 14, 2018 10:20_
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
Maybe it is related to this https://github.com/Microsoft/vscode/issues/55827 issue?
_Copied from original issue: Microsoft/vscode#56335_
I'm not sure the project is configured correctly. Someone on the TS team will know more. When ruuningtsc at the root I see this error:
The 'files' list in config file '/Users/matb/projects/san/vscode-project-references-bug/tsconfig.json' is empty.
2 "files": [],
~~
By tweaking shared/tsconfig.json to:
{
"extends": "../../tsconfig.settings.json",
"compilerOptions": {
"outDir": "../../dist/shared",
"composite": true
},
"files": [
"./logic.ts"
]
}
And compiling server/tsconfig , I do see things work under typescript@next. In TypeScript 3.0.1 however there are tooling failures:
Error: Debug Failure. Bad line number. Line: 2, lineStarts.length: 2 , line map is correct? true
at computePositionOfLineAndCharacter (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:5947:22)
at Object.getPositionOfLineAndCharacter (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:5941:16)
at getPositionOfLineAndCharacterUsingName (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:61588:27)
at processPosition (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:61610:37)
at Object.arrayFrom (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:1129:31)
at calculateDecodedMappings (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:61655:32)
at getDecodedMappings (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:61591:62)
at getGeneratedOrderedMappings (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:61597:80)
at Object.getOriginalPosition (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:61563:28)
at Object.tryGetOriginalLocation (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:99327:63)
at getMappedLocation (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:117945:52)
at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118545:34
at Array.map (<anonymous>)
at IOSession.Session.mapDefinitionInfoLocations (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118544:36)
at IOSession.Session.getDefinitionAndBoundSpan (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118572:40)
at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118004:61)
at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:88
at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119487:28)
at IOSession.Session.executeCommand (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:33)
at IOSession.Session.onMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119516:35)
at Interface.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120770:27)
at emitOne (events.js:116:13)
at Interface.emit (events.js:211:7)
at Interface._onLine (readline.js:282:10)
at Interface._normalWrite (readline.js:424:12)
at Socket.ondata (readline.js:141:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at Pipe.onread (net.js:594:20)
@screendriver Please try upgrading your workspace to use typescript@next by following these instructions
I'm not sure the project is configured correctly. Someone on the TS team will know more. When ruuningtsc at the root I see this error:
Yes, that's because I use the new project references that comes with TypeScript 3. Just do a tsc --build and it works. That project is not meant to be build with tsc as before because project references works differently. With tsc --build the project builds as expected.
That was the reason why I opened the issue https://github.com/Microsoft/vscode/issues/56335 in the Visual Studio Code project because the navigation (Cmd + Click on a import) or finding references (Shift + F12) does not work there. So I believe this is not a tsc issue because this works correctly as expected.
This seems to be working for me with typescript@next with that repository after running tsc --build. Note that I did not run npm install, I used my globally installed typescript@next .
The fact that this fails on computePositionOfLineAndCharacter reminds me of #25844 which should only happen when declaration files are out-of-date, so maybe you can fix by running tsc --build again and restarting vscode?
so maybe you can fix by running tsc --build again and restarting vscode?
This doesn't work. I already tried everything that I could imagine: disabling all extensions, restarting Visual Studio Code, remove and re-install Visual Studio Code...
typescript@next instead of [email protected]?typescript@next?Are you building with typescript@next instead of [email protected]?
Is vscode set up to use typescript@next?
I tried it out now. It works with typescript@next. Great 馃憤
One question @andy-ms : today I saw a new release of TypeScript v3.0.3 With that bugfix it doesn't work. Could it be that @next already pointed to a newer version that will be released after 3.0.3?
Yeah, 3.0.3 only has a small handful of backported bug fixes. Afaik we should be scheduled for a 3.1rc/release in the next two or three weeks.
Most helpful comment
Yeah, 3.0.3 only has a small handful of backported bug fixes. Afaik we should be scheduled for a 3.1rc/release in the next two or three weeks.