-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Goto-definition combined with .d.ts.map file produces location past the end of the file #24866
Comments
Is the problem that the generated sourcemaps is wrong or that we are capable of returning a position beyond the file's bounds when an invalid sourcemap is present? |
That's the sourcemap that |
There is! Some of the declaration map tests make use of it. |
I'm going to hazard a guess that #24886 fixed this. |
Since we're using the feature now, you can reproduce the error by clicking on any |
And we haven't done an lkg but only use light to build, so the change can't be seen in our own project yet. |
Hi @weswigham, could you provide the location of the test helper that will generate a map? |
@weswigham Updated #24867 but it looks like the declaration emit hasn't changed in the master branch. Also, while working on that I've noticed that goto-definition doesn't always go to the right file either -- for example, in |
@andy-ms I'm seeing it go the the right file, but what looks like at least one declaration too far: Although what you're seeing is what happens when the language server is |
@andy-ms So it's worth noting that while we "fixed" your test, it's still entirely possible for us to return a position outside the bounds of a file for the end of a span we return (though probably much less likely now, since every identifier is actually sourcemapped). Do we need to guard against that anywhere? |
We do call |
TypeScript Version: master
Code
See the test "tsserverProjectSystem project references" "goToDefinition" added in #24867.
CC @weswigham
The text was updated successfully, but these errors were encountered: