Fixed more ghost errors after LSP requests caching wrong contextual and parameter types
fixes https://github.com/microsoft/TypeScript/issues/58351 fixes https://github.com/microsoft/TypeScript/issues/62183 supersedes https://github.com/microsoft/TypeScript/pull/58378
It's not enough to ignore cached types/signatures on the ancestry path of the location node of the LSP request. All nodes under that ancestry path can potentially cache wrong types and those types should not be carried over to regular checking scenarios.
This PR chooses a simple solution of ignoring node/symbol links on certain node kinds within the source file of the location node. It might ignore more caches than it has to but the implementation stays fairly straighforward thanks to that.
@jakebailey could you build a playground here?
@typescript-bot pack this
Starting jobs; this comment will be updated as builds start and complete.
| Command | Status | Results |
|---|---|---|
pack this |
✅ Started | ✅ Results |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:
{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/165902/artifacts?artifactName=tgz&fileId=8FE667DC2F0F93798F7AB64A0FC729B1860B4F7B98EF9536272DEF3DE523ED4D02&fileName=/typescript-6.0.0-insiders.20250816.tgz"
}
}
and then running npm install.
There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;
I don't know if this is going to be portable to the new codebase; over there SymbolLinks has been split apart into 5 different maps and I don't know how we're going to replicate this sort of "save and restore" mechanism without pain...