diff --git a/internal/lsp/source/completion.go b/internal/lsp/source/completion.go index af7131fc..2230f608 100644 --- a/internal/lsp/source/completion.go +++ b/internal/lsp/source/completion.go @@ -1,6 +1,7 @@ package source import ( + "bytes" "context" "fmt" "go/ast" @@ -105,7 +106,6 @@ func completions(file *ast.File, pos token.Pos, fset *token.FileSet, pkg *types. if items, ok := complit(path, pos, pkg, info, found); ok { return items, "", nil } - switch n := path[0].(type) { case *ast.Ident: // Set the filter prefix. @@ -440,7 +440,7 @@ func formatType(typ types.Type, qualifier types.Qualifier) (detail string, kind // formatParams correctly format the parameters of a function. func formatParams(t *types.Tuple, variadic bool, qualifier types.Qualifier) string { - var b strings.Builder + var b bytes.Buffer b.WriteByte('(') for i := 0; i < t.Len(); i++ { if i > 0 {