Skip to content
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

Unrelated code shown when pressing Command over symbol #2653

Closed
DanTup opened this issue Jul 20, 2020 · 6 comments
Closed

Unrelated code shown when pressing Command over symbol #2653

DanTup opened this issue Jul 20, 2020 · 6 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Jul 20, 2020

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.

@DanTup DanTup added is bug in editor Relates to code editing or language features labels Jul 20, 2020
@DanTup DanTup added this to the v3.13.0 milestone Jul 20, 2020
@DanTup DanTup changed the title Unrelated code shown when pressing Shift+Option over symbol Unrelated code shown when pressing Command over symbol Jul 28, 2020
@DanTup
Copy link
Member Author

DanTup commented Jul 28, 2020

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

@DanTup DanTup modified the milestones: v3.13.0, v3.14.0 Jul 28, 2020
@DanTup DanTup added the in lsp/analysis server Something to be fixed in the Dart analysis server label Aug 4, 2020
@DanTup
Copy link
Member Author

DanTup commented Aug 10, 2020

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")

@DanTup DanTup added blocked on dart / flutter Requires a change in Dart or Flutter to progress blocked on vs code / lsp / dap Requires a change in VS Code to progress labels Aug 10, 2020
@DanTup DanTup modified the milestones: v3.14.0, On Deck Aug 10, 2020
@DanTup DanTup modified the milestones: On Deck, v3.16.0 Oct 1, 2020
@DanTup DanTup removed the blocked on vs code / lsp / dap Requires a change in VS Code to progress label Oct 26, 2020
@DanTup DanTup modified the milestones: v3.16.0, v3.17.0 Oct 26, 2020
@DanTup
Copy link
Member Author

DanTup commented Oct 26, 2020

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.

@DanTup DanTup closed this as completed in 0c9f01c Nov 3, 2020
@DanTup
Copy link
Member Author

DanTup commented Dec 10, 2020

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.

@DanTup DanTup reopened this Dec 10, 2020
@DanTup DanTup modified the milestones: v3.17.0, v3.18.0 Dec 10, 2020
@DanTup DanTup removed the blocked on dart / flutter Requires a change in Dart or Flutter to progress label Dec 10, 2020
@DanTup
Copy link
Member Author

DanTup commented Dec 10, 2020

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

@DanTup DanTup closed this as completed Dec 10, 2020
@DanTup DanTup modified the milestones: v3.18.0, v3.19.0 Dec 22, 2020
@DanTup
Copy link
Member Author

DanTup commented Dec 22, 2020

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
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Projects
None yet
Development

No branches or pull requests

1 participant