-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include both symbol span and whole definition span for tsserver definitions #30849
Comments
Which one is which in this API? Does the original |
Yes, the existing |
@mjbvz Does this mean we need to add this to everything related to defintions.
|
Ideally yes. I believe that VS Code can use this information in our UI for implementations and type definitions as well. The definition one is the most important to us since it is the most noticeable in the UI |
@mjbvz Few more question. |
…ther places are declaration name Fixes #30849
Your proposal about the handling of the import also makes sense to me |
…r other places are declaration name Fixes #30849
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Problem
VS Code uses typescript's definition requests to render small previews of a declaration when you hover over a symbol and hold
cmd
. However because TS currently only returns the symbol span with definitions, we cannot always guess the range to preview correctly (see microsoft/vscode#72017)For example, for the code:
the
definitionAndBoundSpan
result for the invocation offoo
is:To make our UI more reliable, we need both the symbol span (covering just
foo
in the linefunction foo() {
) as well as entire declaration span (covering all of the function declaration)Proposed api
Keep the existing behavior of
definitionAndBoundSpan
, but tack on additional definition start/end information to each returned span:This should be a backwards compatible change
Related Issues:
The text was updated successfully, but these errors were encountered: