microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.11k stars 12.5k forks source link

Ensure find-all-refs works on unresolved locals #38836

Open DanielRosenwasser opened 4 years ago

DanielRosenwasser commented 4 years ago

Spoke with @amcasey about this one.

Given the following

blah.yadda.yadda

blah will be an unresolved and should be an error, but we still want find-all-references on this symbol to work reasonably well. This is especially important in the mode described in #37713, where TypeScript won't have access to symbols in the global scope.

This can potentially be achieved by creating an "error scope" whose symbol table contents are progressively populated every time resolution fails.

sheetalkamat commented 4 years ago

Another option is to use results of navTo when symbol is not resolved instead of changing symbol tables?