-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/completionIssues related to auto-completion in gopls.Issues related to auto-completion in gopls.
Milestone
Description
gopls version
golang.org/x/tools/gopls v0.13.2
golang.org/x/tools/gopls@v0.13.2 h1:Pyvx6MKvatbX3zzZmdGiFRfQZl0ohPlt2sFxO/5j6Ro=
go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/icholy/.cache/go-build'
GOENV='/home/icholy/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/icholy/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/icholy/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/tmp/scratch/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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4199407928=/tmp/go-build -gno-record-gcc-switches'
What did you do?
package main
import _ "github.com/aws/aws-sdk-go-v2/service/codebuild"
func main() {
json.U // <- trigger completion here
}
What did you expect to see?
Suggest json.Unmarshal
as pre-selected completion.
What did you see instead?
json.InvalidUTF8Error
as pre-selected completion.
Editor and settings
I'm using neovim's built-in lsp client. However, I was able to reproduce this in a vanilla VSCode install with only the Go plugin installed.
Here's the completion response neovim is getting:
{
id = 10,
jsonrpc = "2.0",
result = {
isIncomplete = true,
items = {
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'type (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "InvalidUTF8Error",
insertTextFormat = 2,
kind = 7,
label = "InvalidUTF8Error",
preselect = true,
sortText = "00000",
textEdit = {
newText = "InvalidUTF8Error",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'type (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "InvalidUnmarshalError",
insertTextFormat = 2,
kind = 7,
label = "InvalidUnmarshalError",
sortText = "00001",
textEdit = {
newText = "InvalidUnmarshalError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'func (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Unmarshal",
insertTextFormat = 2,
kind = 3,
label = "Unmarshal",
sortText = "00002",
textEdit = {
newText = "Unmarshal(data, v)",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'type (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnmarshalFieldError",
insertTextFormat = 2,
kind = 7,
label = "UnmarshalFieldError",
sortText = "00003",
textEdit = {
newText = "UnmarshalFieldError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'type (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnmarshalTypeError",
insertTextFormat = 2,
kind = 7,
label = "UnmarshalTypeError",
sortText = "00004",
textEdit = {
newText = "UnmarshalTypeError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'type (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Unmarshaler",
insertTextFormat = 2,
kind = 7,
label = "Unmarshaler",
sortText = "00005",
textEdit = {
newText = "Unmarshaler",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'type (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnsupportedTypeError",
insertTextFormat = 2,
kind = 7,
label = "UnsupportedTypeError",
sortText = "00006",
textEdit = {
newText = "UnsupportedTypeError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"encoding/json',
range = {["end"] = {character = 9, line = 3}, start = {character = 9, line = 3}}
}
},
detail = 'type (from "encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnsupportedValueError",
insertTextFormat = 2,
kind = 7,
label = "UnsupportedValueError",
sortText = "00007",
textEdit = {
newText = "UnsupportedValueError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/aws/smithy-go/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = 'func (from "github.com/aws/smithy-go/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "CollectUnknownField",
insertTextFormat = 2,
kind = 3,
label = "CollectUnknownField",
sortText = "00008",
textEdit = {
newText = "CollectUnknownField(decoder)",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/aws/smithy-go/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = 'func (from "github.com/aws/smithy-go/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "DiscardUnknownField",
insertTextFormat = 2,
kind = 3,
label = "DiscardUnknownField",
sortText = "00009",
textEdit = {
newText = "DiscardUnknownField(decoder)",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Uint",
insertTextFormat = 2,
kind = 6,
label = "Uint",
sortText = "00010",
textEdit = {
newText = "Uint",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Undefined",
insertTextFormat = 2,
kind = 6,
label = "Undefined",
sortText = "00011",
textEdit = {
newText = "Undefined",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Unescape",
insertTextFormat = 2,
kind = 6,
label = "Unescape",
sortText = "00012",
textEdit = {
newText = "Unescape",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Unescaped",
insertTextFormat = 2,
kind = 6,
label = "Unescaped",
sortText = "00013",
textEdit = {
newText = "Unescaped",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Unmarshal",
insertTextFormat = 2,
kind = 6,
label = "Unmarshal",
sortText = "00014",
textEdit = {
newText = "Unmarshal",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnmarshalFieldError",
insertTextFormat = 2,
kind = 6,
label = "UnmarshalFieldError",
sortText = "00015",
textEdit = {
newText = "UnmarshalFieldError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnmarshalTypeError",
insertTextFormat = 2,
kind = 6,
label = "UnmarshalTypeError",
sortText = "00016",
textEdit = {
newText = "UnmarshalTypeError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "Unmarshaler",
insertTextFormat = 2,
kind = 6,
label = "Unmarshaler",
sortText = "00017",
textEdit = {
newText = "Unmarshaler",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnsupportedTypeError",
insertTextFormat = 2,
kind = 6,
label = "UnsupportedTypeError",
sortText = "00018",
textEdit = {
newText = "UnsupportedTypeError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UnsupportedValueError",
insertTextFormat = 2,
kind = 6,
label = "UnsupportedValueError",
sortText = "00019",
textEdit = {
newText = "UnsupportedValueError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "UseNumber",
insertTextFormat = 2,
kind = 6,
label = "UseNumber",
sortText = "00020",
textEdit = {
newText = "UseNumber",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "AppendUnescape",
insertTextFormat = 2,
kind = 6,
label = "AppendUnescape",
sortText = "00021",
textEdit = {
newText = "AppendUnescape",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "DisallowUnknownFields",
insertTextFormat = 2,
kind = 6,
label = "DisallowUnknownFields",
sortText = "00022",
textEdit = {
newText = "DisallowUnknownFields",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "InvalidUTF8Error",
insertTextFormat = 2,
kind = 6,
label = "InvalidUTF8Error",
sortText = "00023",
textEdit = {
newText = "InvalidUTF8Error",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
},
{
additionalTextEdits = {
{
newText = '"\n\t"github.com/segmentio/encoding/json',
range = {["end"] = {character = 51, line = 9}, start = {character = 51, line = 9}}
}
},
detail = '(from "github.com/segmentio/encoding/json")',
documentation = {kind = "markdown", value = ""},
filterText = "InvalidUnmarshalError",
insertTextFormat = 2,
kind = 6,
label = "InvalidUnmarshalError",
sortText = "00024",
textEdit = {
newText = "InvalidUnmarshalError",
range = {["end"] = {character = 7, line = 20}, start = {character = 6, line = 20}}
}
}
}
}
}
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/completionIssues related to auto-completion in gopls.Issues related to auto-completion in gopls.