-
Notifications
You must be signed in to change notification settings - Fork 645
Wrong documentation when there are multiple functions with the same name #2107
Comments
@segevfiner Thanks for reporting! This is a hard problem to solve... We cant use
But this wouldnt work as i.e since T is qualified with the package name in the gocode output but not the one from go doc, its hard to get a match.
Actually the documentation for all the 3 Run() are shown (without the signature) cc @segevfiner |
As I said, we will need to extend |
In the |
…cumentation (#2215) See mdempsky/gocode@be056ad Part of #2107
…umentation (#2223) * Use the newly added receiver output from godef to get the correct documentation See rogpeppe/godef#105 Part of #2107 * Review fixes
Based on the current state, the problem for when using This leaves the docs that appear on hover. @segevfiner Does this problem occur when using the language server as well? cc @stamblerre |
The language server does not have this problem, so I think we can close this issue. |
While Go doesn't support function overloading, you can still have multiple functions with the same name but with a different receiver. For example:
testing
has theRun
function.It seems that
gocode
andgodef
don't supply us with the receiver. Butgo doc
does support receiving it, like sogo doc testing T.Run
.Steps to Reproduce:
foo_test.go
:t.Ru
.testing.B.Run
instead oftesting.T.Run
.Run:
gocode -f=json -builtin -in=foo_test.go autocomplete 74 | python -m json.tool
to see whatgocode
gives us,go doc testing Run
to see what we get fromgo doc
, andgo doc testing T.Run
for what we would have liked to get.vscode-go v0.7.0
The text was updated successfully, but these errors were encountered: