Skip to content

Goto-definition combined with .d.ts.map file produces location past the end of the file #24866

Closed

Description

TypeScript Version: master

Code

See the test "tsserverProjectSystem project references" "goToDefinition" added in #24867.

CC Wesley Wigham (@weswigham)

Activity

  1. weswigham commented on Jun 11, 2018

    @weswigham
    Member

    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?

  2. weswigham commented on Jun 11, 2018

    @weswigham
    Member

    There is! Some of the declaration map tests make use of it.

  3. weswigham commented on Jun 12, 2018

    @weswigham
    Member

    I'm going to hazard a guess that #24886 fixed this.

  4. weswigham commented on Jun 15, 2018

    @weswigham
    Member

    I'm going to hazard a guess that #24886 fixed this.

    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.

  5. weswigham commented on Jun 15, 2018

    @weswigham
    Member
  6. weswigham commented on Jun 15, 2018

    @weswigham
    Member

    Andy (Andrewkraft) (@Andy-MS) I'm seeing it go the the right file, but what looks like at least one declaration too far:

    less-off

    Although what you're seeing is what happens when the language server is vscode's builtin 2.9.1, instead of a more recent build with #24886 in.

  7. weswigham commented on Jun 27, 2018

    @weswigham
    Member

    Andy (Andrewkraft) (@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?

  8. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions