I have the ms-vscode.go
Go extension installed in my VS Code setup and am using the gopls
language server. The language server seems to perform well with Intellisense operations except when I am editing imports, at which point there is considerable lag as every edit to the import takes several seconds to update.
For example, the following is a replay of typing in manually import "net/http"
letter-by-letter (rather than copy/paste). The clip runs at 20x speed, so it takes about 1.8 minutes from when I stop typing the import statement to when the language server gets to the correct error of "net/http" imported but not used
:
Am I doing something wrong?
My go-related settings:
"go.useLanguageServer": true,
"go.alternateTools": {
"go-langserver": "gopls"
},
Output from gopls
reveals that much time is spent in go list
:
4.037297s for ...go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" ...
for every change.