x/tools/gopls: add gopls.package_info command #51490
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
gopls version
go env
What did you do?
I'm developing a vim/neovim plugin that need to retrieve the package name of the current buffer. E.g. I'd like to show the current package name for the buffer in status line or I need to use the package name to filter symbols belongs to the current package using the package name as prefix
What work around did you consider?
I'm using
go list
at the moment as a work around. I see vim-go does the same.The command executed is just
go list -f {{.Name}} file.go
with thefile.go
's folder as cwd.What solution do you want to see?
I think this information should be provided as a LSP command. I propose:
Identifier:
gopls.package_info
Retrieve the package info for a given go file.
Args:
Result:
Editor and settings
I'm using neovim 0.6.1 with coc.nvim. Using the default instruction from gopls editor section
The text was updated successfully, but these errors were encountered: