Skip to content

Commit 61bea58

Browse files
committed
gopls/internal/lsp/source: GopSignatureHelp skip hover doc for overload object
1 parent 5ec020e commit 61bea58

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func _() {
2+
Demo //@signature_overload(" //", "Demo__1(n int) int", 1, 0)
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func _() {
2+
Demo 100,//@signature_overload("//", "Demo__2(n1 int, n2 int)", 2, 1)
3+
}

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

+7-5
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,14 @@ FindCall:
146146
comment *ast.CommentGroup
147147
)
148148
if obj != nil {
149-
d, err := HoverDocForObject(ctx, snapshot, pkg.FileSet(), obj)
150-
if err != nil && !overloads {
151-
return nil, 0, 0, err
152-
}
153149
name = obj.Name()
154-
comment = d
150+
if !overloads {
151+
d, err := HoverDocForObject(ctx, snapshot, pkg.FileSet(), obj)
152+
if err != nil {
153+
return nil, 0, 0, err
154+
}
155+
comment = d
156+
}
155157
} else {
156158
name = "func"
157159
}

0 commit comments

Comments
 (0)