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

LspShowImpl alternative to LspPeekImpl #574

Closed
JetSetIlly opened this issue Nov 15, 2024 · 5 comments
Closed

LspShowImpl alternative to LspPeekImpl #574

JetSetIlly opened this issue Nov 15, 2024 · 5 comments

Comments

@JetSetIlly
Copy link

Would it be possible for a LspShowImpl command be added?

There is a LspPeekImpl command but I prefer how the LspShowReferences command works as compared to the peek commands. Peek is good but showing the list in the quickfix suits my workflow better.

@JetSetIlly
Copy link
Author

After posting the request I decided to have a closer look. It seems to be as simple as this:

command! -nargs=0 -bar -count LspShowImpl lsp.GotoImplementation(v:false, <q-mods>, <count>)

Is that right? Or does it need anything else?

@yegappan
Copy link
Owner

When you can have multiple locations where a symbol is referenced or defined, then using a quickfix or location list makes sense. The LspShowImpl command will show only one location where a symbol is implemented. So the quickfix list will have only one entry?

@JetSetIlly
Copy link
Author

Hmm. Maybe it depends on the language the LSP is for.

I'm primarily interested in Go and so I'm using gopls. In my case, the proposed LspShowImpl command shows many locations in the quickfix.

@yegappan
Copy link
Owner

I see that we already have the "LspGotoImpl" command which provides the exact same functionality. Can you use that command?

@JetSetIlly
Copy link
Author

I see that we already have the "LspGotoImpl" command which provides the exact same functionality. Can you use that command?

Ah. I didn't spot that. I was too busy looking at the Show group of commands.

LspGotoImpl is exactly what I need. Thanks.

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

2 participants