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

Inline "Navigating to parent method" #101

Open
nilskp opened this issue Apr 15, 2020 · 4 comments
Open

Inline "Navigating to parent method" #101

nilskp opened this issue Apr 15, 2020 · 4 comments

Comments

@nilskp
Copy link

nilskp commented Apr 15, 2020

Describe the solution you'd like
We now have "Navigating to parent method" in Metals. This is great.

But unfortunately it works by adding an additional line above the current definition, which takes up space and is somewhat distracting.

Describe alternatives you've considered
When referencing a value or method, it's possible to navigate to the definition through Ctrl+hover+click. However when doing the same on the actual implementation of a method, this has no effect (as it's already there).

It would make sense to instead use this for navigating to parent method (if existing). This retains the mechanics (and semantics) of Ctrl+hover+click, and would be stylistically less intrusive.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 15, 2020

Thanks for reporting! I agree it would be better if it didn't create an additional line, but is not something that Metals control for lenses.

When referencing a value or method, it's possible to navigate to the definition through Ctrl+hover+click. However when doing the same on the actual implementation of a method, this has no effect (as it's already there).

This currently shows references to the symbol, so we can't unfortunately reuse that.

The alternative is to turn off the new code lenses and use the command via shortcut, which should work the same.

I am also thinking that maybe we could use the decoration protocol, which has more flexibility, but it will be more complicated.

@kubukoz
Copy link

kubukoz commented Apr 17, 2020

Can that be triggered by a command? I can't see it in the pallette...

image

@tgodzik
Copy link
Contributor

tgodzik commented Apr 17, 2020

Can that be triggered by a command? I can't see it in the pallette...

image

It's not in the palette, you can assign a shortcut to it. It might actually be good to add it to the palette. Haven't though of it - it should be pretty easy to do actually in metals-vscode. We can open an issue there.

@olafurpg
Copy link
Member

I think it would be nice to have this available in the command palette. I have also tried several times this week to execute a "Go to super method" or "Go to parent" command. I would lean slightly towards naming it "Go to super method"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants