Skip to content

Commit

Permalink
fix:unexpected gop overload completion in go
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed May 9, 2024
1 parent ab79a37 commit efbbe12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gopls/internal/lsp/source/completion/deep_completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"
"time"

"github.com/goplus/gogen"
"github.com/qiniu/x/log"
"golang.org/x/tools/gopls/internal/goxls"
)
Expand Down Expand Up @@ -131,14 +132,17 @@ func (c *completer) deepSearch(ctx context.Context, start time.Time, deadline *t
for len(c.deepState.nextQueue) > 0 && (first || deadline == nil || time.Now().Before(*deadline)) {
first = false
c.deepState.thisQueue, c.deepState.nextQueue = c.deepState.nextQueue, c.deepState.thisQueue[:0]

outer:
for _, cand := range c.deepState.thisQueue {
obj := cand.obj
if obj == nil {
continue
}

if sig, ok := obj.Type().(*types.Signature); ok {
if _, ok := gogen.CheckSigFuncEx(sig); ok {
continue
}
}
// At the top level, dedupe by object.
if len(cand.path) == 0 {
if c.seen[obj] {
Expand Down

0 comments on commit efbbe12

Please sign in to comment.