Skip to content

Commit 5317937

Browse files
committed
update:support overload anonymous reference
1 parent ab79a37 commit 5317937

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: gopls/internal/lsp/source/implementation_gox.go

+2
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ func gopPathEnclosingObjNode(f *ast.File, pos token.Pos) []ast.Node {
430430
if pos == n.Star {
431431
pos = n.X.Pos()
432432
}
433+
case *ast.FuncLit:
434+
found = n.Type.Func == pos
433435
}
434436

435437
return !found

Diff for: gopls/internal/lsp/source/references_gox.go

+3
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,9 @@ func gopObjectsAt(info *typesutil.Info, file *ast.File, pos token.Pos) (map[type
581581
return nil, nil, fmt.Errorf("%w for import %s", errNoObjectFound, GopUnquoteImportPath(leaf))
582582
}
583583
targets[obj] = leaf
584+
case *ast.FuncLit:
585+
obj := info.Implicits[leaf]
586+
targets[obj] = leaf
584587
}
585588

586589
if len(targets) == 0 {

0 commit comments

Comments
 (0)