Skip to content

Commit

Permalink
gopls/v0.13.2 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Oct 16, 2023
1 parent a6a9e28 commit b8078ad
Show file tree
Hide file tree
Showing 55 changed files with 100 additions and 3 deletions.
2 changes: 2 additions & 0 deletions go/analysis/unitchecker/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package unitchecker

/*
import (
"go/token"
"go/types"
Expand All @@ -24,3 +25,4 @@ func SetTypeImportExport(
makeTypesImporter = MakeTypesImporter
exportTypes = ExportTypes
}
*/
3 changes: 2 additions & 1 deletion go/analysis/unitchecker/separate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package unitchecker_test

// This file illustrates separate analysis with an example.

/*
import (
"bytes"
"encoding/json"
Expand Down Expand Up @@ -309,3 +309,4 @@ func extractTxtar(ar *txtar.Archive, dir string) error {
}
return nil
}
*/
2 changes: 1 addition & 1 deletion gopls/goxls/cmd/goxls/goxls_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ package main
import "golang.org/x/tools/gopls/goxls"

func main() {
goxls.Main(nil, nil)
goxls.Main()
}
15 changes: 15 additions & 0 deletions gopls/goxls/goxls.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package goxls

/*
import (
"context"
"io"
Expand All @@ -21,3 +22,17 @@ func Main(in io.ReadCloser, out io.WriteCloser) {
app.Serve.Out = out
tool.Main(ctx, app, os.Args[1:])
}
*/
import (
"context"
"os"

"golang.org/x/tools/gopls/internal/hooks"
"golang.org/x/tools/gopls/internal/lsp/cmd"
"golang.org/x/tools/internal/tool"
)

func Main() {
ctx := context.Background()
tool.Main(ctx, cmd.New("goxls", "", nil, hooks.Options), os.Args[1:])
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions gopls/internal/lsp/cache/filemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cache

/*
import (
"path/filepath"
Expand Down Expand Up @@ -149,3 +150,4 @@ func (m *fileMap) Dirs() *persistent.Set[string] {
}
return m.dirs
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/cache/filemap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cache

/*
import (
"path/filepath"
"sort"
Expand Down Expand Up @@ -106,3 +107,4 @@ func TestFileMap(t *testing.T) {
})
}
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/cache/parse_cache_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cache

/*
import (
"bytes"
"container/heap"
Expand Down Expand Up @@ -205,3 +206,4 @@ func (c *parseCache) parseGopFiles(ctx context.Context, fset *token.FileSet, mod
return pgfs, firstErr
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/cache/parse_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cache

/*
import (
"context"
"fmt"
Expand Down Expand Up @@ -157,3 +158,4 @@ func fixGopAST(n ast.Node, tok *token.File, src []byte) (fixes []fixType) {
func fixGopSrc(f *ast.File, tf *token.File, src []byte) (newSrc []byte, fix fixType) {
return nil, noFix
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/cache/pkg_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cache

/*
import (
"fmt"
Expand All @@ -29,3 +30,4 @@ func (pkg *syntaxPackage) GopFile(uri span.URI) (*source.ParsedGopFile, error) {
}
return nil, fmt.Errorf("no parsed file for %s in %v", uri, pkg.id)
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/cache/snapshot_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cache

/*
import (
"golang.org/x/tools/gopls/internal/goxls/goputil"
"golang.org/x/tools/gopls/internal/lsp/source"
Expand All @@ -12,3 +13,4 @@ import (
func checkGopFile(fh source.FileHandle, fext string) bool {
return goputil.FileKind(fext) != 0
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/cmd/serve_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cmd

/*
import (
"io"
"os"
Expand All @@ -22,3 +23,4 @@ func (s *Serve) reqOut() io.WriteCloser {
}
return os.Stdout
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package lsp

/*
import (
"context"
"fmt"
Expand Down Expand Up @@ -315,3 +316,4 @@ func acquireLockFile(path string) (func(), bool, error) {
}
return release, true, nil
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/prompt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package lsp

/*
import (
"path/filepath"
"sync"
Expand Down Expand Up @@ -80,3 +81,4 @@ func TestReleaseAndAcquireFileLock(t *testing.T) {
t.Fatalf("failed to Acquire")
}
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/builtin_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"context"
"go/types"
Expand Down Expand Up @@ -146,3 +147,4 @@ func (c *gopCompleter) builtinArgType(obj types.Object, call *ast.CallExpr, pare
return inf
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/completion_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"context"
"fmt"
Expand Down Expand Up @@ -2515,3 +2516,4 @@ func gopForEachPackageMember(content []byte, f func(tok token.Token, id *ast.Ide
}
}
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/deep_completion_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"context"
"go/types"
Expand Down Expand Up @@ -105,3 +106,4 @@ func (c *gopCompleter) objChainMatches(cand *candidate, chain []types.Object) bo
return true
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/definition_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"go/types"
"strings"
Expand Down Expand Up @@ -97,3 +98,4 @@ func gopDefinition(path []ast.Node, obj types.Object, pgf *source.ParsedGopFile)
}
return ans, sel
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/format_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"context"
"fmt"
Expand Down Expand Up @@ -337,3 +338,4 @@ func (c *gopCompleter) importEdits(imp *importInfo) ([]protocol.TextEdit, error)
FixType: imports.AddImport,
})
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/fuzz_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"fmt"
"go/types"
Expand Down Expand Up @@ -134,3 +135,4 @@ Loop:
// let the standard processing take care of it instead
return false
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/keywords_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"github.com/goplus/gop/ast"
"golang.org/x/tools/gopls/internal/lsp/protocol"
Expand Down Expand Up @@ -123,3 +124,4 @@ func (c *gopCompleter) addKeywordItems(seen map[string]bool, score float64, kws
}
}
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/labels_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
// wantLabelCompletion returns true if we want (only) label
// completions at the position.
func (c *gopCompleter) wantLabelCompletion() labelType {
Expand All @@ -16,3 +17,4 @@ func (c *gopCompleter) wantLabelCompletion() labelType {
func (c *gopCompleter) labels(lt labelType) {
panic("todo")
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/literal_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"context"
"fmt"
Expand Down Expand Up @@ -521,3 +522,4 @@ func (c *gopCompleter) typeParamInScope(tp *typeparams.TypeParam) bool {
_, foundObj := scope.LookupParent(obj.Name(), c.pos)
return obj == foundObj
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/package_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"context"
"errors"
Expand Down Expand Up @@ -33,3 +34,4 @@ func (c *gopCompleter) packageNameCompletions(ctx context.Context, fileURI span.
}
return nil
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/postfix_snippets_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"context"
"fmt"
Expand Down Expand Up @@ -168,3 +169,4 @@ func (c *gopCompleter) importIfNeeded(pkgPath string, scope *types.Scope) (strin
return defaultName, edits, nil
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/printf_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"go/constant"
"go/types"
Expand Down Expand Up @@ -47,3 +48,4 @@ func gopPrintfArgKind(info *typesutil.Info, call *ast.CallExpr, argIdx int) objK
return formatOperandKind(constant.StringVal(strArg), argIdx-(numParams-1)+1)
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/snippet_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"github.com/goplus/gop/ast"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
Expand Down Expand Up @@ -118,3 +119,4 @@ func (c *gopCompleter) functionCallSnippet(name string, tparams, params []string
snip.WriteText(")")
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/statements_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"fmt"
"go/types"
Expand Down Expand Up @@ -359,3 +360,4 @@ func gopGetTestVar(enclosingFunc *gopFuncInfo, pkg source.Package) string {
return ""
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/completion/util_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package completion

/*
import (
"go/types"
Expand Down Expand Up @@ -124,3 +125,4 @@ func (c *gopCompleter) editText(from, to token.Pos, newText string) ([]protocol.
New: newText,
}})
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/format_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package source

/*
import (
"bytes"
"context"
Expand Down Expand Up @@ -105,3 +106,4 @@ func isClass(fh FileHandle) bool {
fext := filepath.Ext(fh.URI().Filename())
return goputil.FileKind(fext) == goputil.FileGopClass
}
*/
2 changes: 2 additions & 0 deletions gopls/internal/lsp/source/highlight_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package source

/*
import (
"go/types"
Expand All @@ -23,3 +24,4 @@ func GopImportedPkgName(info *typesutil.Info, imp *ast.ImportSpec) (*types.PkgNa
pkgname, ok := obj.(*types.PkgName)
return pkgname, ok
}
*/
Loading

0 comments on commit b8078ad

Please sign in to comment.