Vim-go: Feature: Convert :GoCallers to use gopls when enabled

Created on 10 Feb 2020  路  7Comments  路  Source: fatih/vim-go

When gopls is enabled and working it would be nice to use it for callers and friends instead of the very old go guru program.

Most helpful comment

It would be nice, and I've been trying to figure out a way to do it, but haven't figured out a good way yet. In the meantime, you can use :GoReferrers to get close to the same behavior.

All 7 comments

It would be nice, and I've been trying to figure out a way to do it, but haven't figured out a good way yet. In the meantime, you can use :GoReferrers to get close to the same behavior.

It would be nice, and I've been trying to figure out a way to do it, but haven't figured out a good way yet. In the meantime, you can use :GoReferrers to get close to the same behavior.

yes.

:GoReferrers can show the refs in Quickfix List. If I choose one ref, the quickfix list context is empty and not closed automatically.

coc.nvim <Plug>(coc-references) impls this feature is better,
Will vim-go implement the same feature?

Thank you.

If I choose one ref, the quickfix list context is empty and not closed automatically.

Are you saying that the quickfix list has all of its entries removed after you jump to one of the refs? That's odd and doesn't match any behavior that I know about.

coc.nvim (coc-references) impls this feature is better,
Will vim-go implement the same feature?

:GoReferrers has two modes: gopls and guru. The only difference is where it gets the data from. There aren't currently any plans to refactor. If you'd like to suggest a behavior change, feel free to open a new issue to describe and discuss it.

guru's callers and callees functionality is closer to LSP's callHierarchy feature, which gopls doesn't yet support: https://github.com/golang/go/issues/39461.

Thanks, @stamblerre. I subscribed to golang/go#39461 so I can modify vim-go when the gopls feature lands.

As a follow-up, call hierarchy has now been implemented and released in the latest few versions of gopls.

Thanks, Rebecca. Despite having subscribed to https://github.com/golang/go/issues/39461, I missed when it was closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

orlangure picture orlangure  路  3Comments

joeblubaugh picture joeblubaugh  路  3Comments

derekchiang picture derekchiang  路  3Comments

zhangjing picture zhangjing  路  3Comments

danielmanesku picture danielmanesku  路  4Comments