-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/gopls: unused completions after "." ".." or "........" #37358
Comments
/cc @muirdm |
I can guess what the issue is about, but it would still be helpful to answer the issue template questions. "." alone is a syntax error so gopls falls back to lexical completions. This case is more noticeable than others since "." triggers completions in most editors. However, for example, triggering completions after a lone "(" results in the same thing: package "main"
main () {
(
} |
Sorry for my poor English. It happens mainly in the following case:
Cursor is at '|'.
This doesn't popups completion menu here(emacs+lsp-mode). |
Another related issue:
Cursor is at "|". There are many completion items. And they don't have prefix "aaaaaa". |
Run
That is a separate issue and is actually fixed on master. Completions at the file level scope are special (only keywords are allowed). |
Yes.
Thanks. |
My first reaction is that this is an editor bug. Editors should not trigger completion after multiple ".", only after a single one. That being said, VSCode seems to also pop up completions automatically after "...", so perhaps it is worth suppressing completions when the cursor is directly after the "...". @stamblerre what do you think? |
I don't think it's unusual for the editor to do completions like that, given you declare that it should send completions so after a If I were typing I'd personally suppress after |
Change https://golang.org/cl/222200 mentions this issue: |
example code:
What version of Go are you using (
go version
)?1.13.5
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jun/Library/Caches/go-build"
GOENV="/Users/jun/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jun/Projects/go"
GOPRIVATE=""
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/local/Cellar/go/1.13.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jun/Projects/go/src/golang.org/x/tools/gopls/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/yl/0xyrgw396fj89vd1n2vk649c0000gn/T/go-build115939707=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: