Open
Description
gopls version
~/s/g/gopls (master|✔) $ gopls -v version
Build info
----------
golang.org/x/tools/gopls v0.11.0
golang.org/x/tools/gopls@v0.11.0 h1:/nvKHdTtePQmrv9XN3gIUN9MOdUrKzO/dcqgbG6x8EY=
github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/go-cmp@v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/exp@v0.0.0-20221031165847-c99f073a8326 h1:QfTh0HpN6hlw6D3vu8DAwC8pBIwikq0AI1evdm+FksE=
golang.org/x/exp/typeparams@v0.0.0-20221031165847-c99f073a8326 h1:fl8k2zg28yA23264d82M4dp+YlJ3ngDcpuB1bewkQi4=
golang.org/x/mod@v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/sync@v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sys@v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/text@v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/tools@v0.3.1-0.20221213193459-ca17b2c27ca8 h1:7/HkGkN/2ktghBCSRRgp31wAww4syfsW52tj7yirjWk=
golang.org/x/vuln@v0.0.0-20221109205719-3af8368ee4fe h1:qptQiQwEpETwDiz85LKtChqif9xhVkAm8Nhxs0xnTww=
honnef.co/go/tools@v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
mvdan.cc/gofumpt@v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.20.1
~/s/g/gopls (master|✔) $
go env
~/s/moar (master|✔) $ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/johan/Library/Caches/go-build"
GOENV="/Users/johan/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/johan/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/johan/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.20.1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.20.1/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/johan/src/moar/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cg/d7qzk4s13s9c8t49t3txdjpr0000gn/T/go-build4241905905=/tmp/go-build -gno-record-gcc-switches -fno-common"
~/s/moar (master|✔) $
What did you do?
Typing in this go.mod
file.
On the github.com/sirupsen/logrus
line, I deleted v1.8.1
and typed just a v
instead.
module github.com/walles/moar
go 1.16
require (
github.com/alecthomas/chroma/v2 v2.4.0
github.com/google/go-cmp v0.5.9
github.com/sirupsen/logrus v1.8.1
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
gotest.tools/v3 v3.3.0
)
What did you expect to see?
Version number completions:
v1.9.0
(latest version as I'm typing in this issue)
What did you see instead?
No completion, just the v
that I typed.
Editor and settings
vscode.json
:
{
"go.useLanguageServer": true,
"go.toolsManagement.autoUpdate": true,
"go.lintTool": "golangci-lint"
}
Logs
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
findleyr commentedon Mar 2, 2023
I agree, this would be nice. Thank you for the suggestion.
walles commentedon May 6, 2023
Two questions on how to test this:
I tried to make a test file like this one but with a
require
line likemvdan.cc/xurls v1. //@complete(re"v1.", "v1.1.0"), diag("v1.", re"must be of the form v1.2.3")
.However, it seems like the testing framework doesn't want to load incomplete
go.mod
files. Is this correct? What would be the easiest way to make ago.mod
completions test?Is there a way of faking
go list -m -versions
output for a module while testing? I want to avoid having the tests break suddenly because some maintainer decides to publish a new version of some package?findleyr commentedon May 10, 2023
Hi @walles answers below:
mvdan.cc/xurls v1.0.0
and still trigger completion atre"v1."
findleyr commentedon May 11, 2023
@walles the marker tests now support proxy files. See https://go.dev/cl/494396 for examples.