Replies: 1 comment 3 replies
-
Try {
"languageserver": {
"go": {
"command": "gopls",
"rootPatterns": [
"go.mod"
],
"trace.server": "verbose",
"filetypes": [
"go"
],
"initializationOptions": {
"gopls": {
"formatting.local": "github.com/my_loacal_pacakge"
}
}
}
},
} If you're using https://github.com/josa42/coc-go, you can use
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order to group the import packages, I want to do something like
goimports -local "my_loacal_pacakge"
. This is a feature supported by goimports. Here's an example golang/go#12420.Both Goland and Vscode have ways to setup it. The setting is at https://stackoverflow.com/questions/38704769/golang-import-grouping-by-package and https://stackoverflow.com/questions/68765400/the-option-formatting-local-in-vscode-go-its-working.
For me, it's like passing an arguments to the gopls, so I found it at gopls documents. https://github.com/golang/tools/blob/master/gopls/doc/vim.md#cocnvim
I tried to create the coc-setting.vim below, but it doesn't work.
Can someone help me point what's the right settings in coc.nvim? TIA
Beta Was this translation helpful? Give feedback.
All reactions