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

Jump to file in import ... as .. clause doesn't work #2572

Closed
CareF opened this issue Jun 18, 2020 · 3 comments
Closed

Jump to file in import ... as .. clause doesn't work #2572

CareF opened this issue Jun 18, 2020 · 3 comments
Labels
fixed in lsp in editor Relates to code editing or language features is bug
Milestone

Comments

@CareF
Copy link

CareF commented Jun 18, 2020

Currently we can jump to the import file with <cmd> + click, but if the import clause is import '...' as ..; It doesn't recognize the file path correctly.

Screen Recording 2020-06-18 at 6 07 43 PM

I'm not sure if it's intended so or if I didn't config it correctly, but I would assume consistent behavior should be better.

@DanTup
Copy link
Member

DanTup commented Jun 22, 2020

Thanks for the report! This issue was fixed in the Dart SDK LSP server as part of #2535. In a future release of the SDK when using LSP (which you can opt in to with the dart.previewLsp setting, but will eventually become default) you should see the fix.

In the meantime, when you ctrl+click as sown in your screenshot, VS Code should open a "peek" window that lets you see navigate to the definition (though it requires an extra step to select it). Let me know if that's not working for you. Thanks!

@DanTup DanTup added this to the v3.12.0 milestone Jun 22, 2020
@DanTup DanTup added in editor Relates to code editing or language features is bug labels Jun 22, 2020
@CareF
Copy link
Author

CareF commented Jun 22, 2020

It works. Thanks!
Using LSP the hyperlink-like underline always shows in a keyword like the second case in my screenshot, I would assume it would make more sense if the underline shows on the whole '...' import package name, like the first case in the screenshot.

@CareF CareF closed this as completed Jun 22, 2020
@DanTup
Copy link
Member

DanTup commented Jun 22, 2020

Yeah, I agree. In order to fix that for LSP we need to adopt a new API that allows us to return which range the definition applies to. I've got a note to fix that, though it's not a priority as it's mostly cosmetic. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in lsp in editor Relates to code editing or language features is bug
Projects
None yet
Development

No branches or pull requests

2 participants