Skip to content

Unrelated code shown when pressing Command over symbol #2653

Closed

Description

@DanTup

When pressing Shift+Option over this Icon reference, it shows a snippet of code from the definition, but it seems to include a few lines before (which is unrelated code) that is a bit confusing.

Screenshot 2020-07-20 at 15 41 22

Happens the same in both LSP and DAS.

Activity

  1. added this to the v3.13.0 milestone on Jul 20, 2020
  2. changed the title [-]Unrelated code shown when pressing Shift+Option over symbol[/-] [+]Unrelated code shown when pressing Command over symbol[/+] on Jul 28, 2020
  3. DanTup commented on Jul 28, 2020

    @DanTup
    MemberAuthor

    This might be because we're not returning one of the data types with the extra ranges on:

    https://microsoft.github.io/language-server-protocol/specifications/specification-current/#locationLink

  4. modified the milestones: v3.13.0, v3.14.0 on Jul 28, 2020
  5. DanTup commented on Aug 10, 2020

    @DanTup
    MemberAuthor

    I've got an SDK branch (lsp-def-code-offset-new) that supplies this, but I've hit two issues:

    1. VS Code seems to use the opposite range to what I'd expect: Holding Cmd while hovering a symbol shows LocationLink's "targetSelectionRange" instead of "selectionRange" as preview microsoft/vscode#104369
    2. codeOffset/codeLength is missing from the element for "add" in the example above (though it's present for "Icons")
  6. modified the milestones: v3.14.0, On Deck on Aug 10, 2020
  7. modified the milestones: On Deck, v3.16.0 on Oct 1, 2020
  8. modified the milestones: v3.16.0, v3.17.0 on Oct 26, 2020
  9. DanTup commented on Oct 26, 2020

    @DanTup
    MemberAuthor

    The LSP server side of this is done, but this requires moving to an updated LSP client library that hasn't been published yet:

    microsoft/vscode#104369

    We could consider using the pre-release version in the meantime.

  10. DanTup commented on Dec 10, 2020

    @DanTup
    MemberAuthor

    Using this pre-release package has introduced an issue when using LSP against the server built for v3.16 so this needs to be reverted.

  11. reopened this on Dec 10, 2020
  12. modified the milestones: v3.17.0, v3.18.0 on Dec 10, 2020
  13. DanTup commented on Dec 10, 2020

    @DanTup
    MemberAuthor

    This is re-broken in v3.17.1 to fix #3001, and re-fixed in v3.18.0.

  14. modified the milestones: v3.18.0, v3.19.0 on Dec 22, 2020
  15. DanTup commented on Dec 22, 2020

    @DanTup
    MemberAuthor

    Bumping to v3.19 as this relies on the updated LSP client.

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 bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions