Consistently order and differentiate navto
results
#49103
Labels
Domain: Symbol Navigation
Relates to go-to-definition, find-all-references, highlighting/occurrences.
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
In some circumstances, it is possible to have both an input and output file present in open projects at the same time. The motivating example was in VS when a TS file is open in one editor tab and a cshtml file consuming the corresponding JS file via
<script src=
is open in another (VS rewrites the<script src=
to a triple-slash reference before sending the text to the server). In this scenario, the TS file is open in a configured project and the JS file is closed, but present, in an inferred project. (This particular scenario does not affect VS Code, which does not rewrite<script src=
, but you can just open both files.)When navigate-to (protocol request
navto[-full]
), aka go-to-symbol, is invoked, it shows declarations from both the TS and the JS files. While it's possible they could be de-dup'd through some amount of source-mapping or other relationship tracking, that is likely to be prohibitively expensive for the number of entries involved in a typicalnavto
response.Instead, we should just ensure that the elements are returned in a predictable order (e.g. always prefer TS) and, ideally, provide enough information to differentiate them (presently, they both get the same icon, indicating only the type of symbol).
The text was updated successfully, but these errors were encountered: