Skip to content

Commit efbbe12

Browse files
committed
fix:unexpected gop overload completion in go
1 parent ab79a37 commit efbbe12

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

gopls/internal/lsp/source/completion/deep_completion.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"strings"
1111
"time"
1212

13+
"github.com/goplus/gogen"
1314
"github.com/qiniu/x/log"
1415
"golang.org/x/tools/gopls/internal/goxls"
1516
)
@@ -131,14 +132,17 @@ func (c *completer) deepSearch(ctx context.Context, start time.Time, deadline *t
131132
for len(c.deepState.nextQueue) > 0 && (first || deadline == nil || time.Now().Before(*deadline)) {
132133
first = false
133134
c.deepState.thisQueue, c.deepState.nextQueue = c.deepState.nextQueue, c.deepState.thisQueue[:0]
134-
135135
outer:
136136
for _, cand := range c.deepState.thisQueue {
137137
obj := cand.obj
138138
if obj == nil {
139139
continue
140140
}
141-
141+
if sig, ok := obj.Type().(*types.Signature); ok {
142+
if _, ok := gogen.CheckSigFuncEx(sig); ok {
143+
continue
144+
}
145+
}
142146
// At the top level, dedupe by object.
143147
if len(cand.path) == 0 {
144148
if c.seen[obj] {

0 commit comments

Comments
 (0)