Skip to content

"Go to Symbol in Workspace" navigates to wrong location #4129

Closed

Description

@DanTup
  • Commit a0bfd8c needs reverting (+ version check adding?) once this is fixed.

Failing test:

AssertionError [ERR_ASSERTION]: /home/runner/.pub-cache/git/protobuf.dart-53a1448f6da7a8035654cf502f1c62b45885bb63/protobuf/lib/protobuf.dart should end with /src/protobuf/protobuf_enum.dart)
      + expected - actual

Can be reproduced by adding the protobuf package to a project then trying to navigate to ProtobufEnum. It takes you to the lib/protobuf.dart file which is not where the class is defined.

Issue might have started with Dart 2.18.

Activity

  1. added this to the v3.50.0 milestone on Aug 30, 2022
  2. added
    in editorRelates to code editing or language features
    on Aug 30, 2022
  3. added a commit that references this issue on Aug 30, 2022
  4. DanTup commented on Aug 30, 2022

    @DanTup
    MemberAuthor

    This does seem specific to Dart v2.18. It seems to occur for parts. If a definition is inside a part class, the navigation goes to the parent part of file. I think it started with dart-lang/sdk@11c201c which (I think accidentally) changed to using the parents FileState to get the file path and LineInfo instead of the parts CompilationUnit.

  5. DanTup commented on Aug 30, 2022

    @DanTup
    MemberAuthor
  6. DanTup commented on Oct 3, 2022

    @DanTup
    MemberAuthor
  7. added
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions