-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
// CC @mjbvz
The tslint-language-service plugin runs tslint as a language service extension. This works nicely for simple tslint rules, but for rules that require the typechecker the tsserver ends up hanging with a 'scriptInfo for file ... lib/lib.d.ts' is missing assertion.
This could be an issue in tslint (the rules that use the type checker work fine on the command line) or this can be an issue in the tsserver.
Here are the steps to reproduce (update: does not repro on Linux, repos on Windows):
- enable debugging of the tsserver so that we can attach a debugger later
set TSS_DEBUG=5859
- enable tracing
set TSS_LOG=-level verbose -file c:\tmp\tsserver.log
- git clone https://github.com/egamma/test-ts-server-plugin.git
- cd test-ts-server-plugin
- npm install (installs tslint, ts-language-service plugin, and the TS insider version)
- code-insiders .
- switch to the workspace version of TS using the version switcher in the bottom right corner
- open
hello.ts
, there is a tslint warning with a quick fix and all is good, you can make edits in the file
- open tslint.json and uncomment the
no-unused-variable
rule on line 6. Since tslint 5 this rule requires the TS type checker, see the breaking changes section in the tslint release notes. - save and restart code-insiders or run
reload window
- open
hello.ts
- you will still see tslint warning
- change the contents of
hello.ts
to trigger a syntax check ->the tsserver is now no longer responding to requests, e.g. no more hovers. You can also verify this by inspecting the trace inc:\tmp\tsserver.log
.
Debugging
To debug the current server state you can attach the debugger from another VS Code version. In this setup I describe using the vscode stable version.
- open
code
(the stable version) on an empty workspace. - create the following launch configuration
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to TS Server",
"port": 5859,
"sourceMaps": true,
"protocol": "legacy",
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
}
]
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue