golang / gddo

Go Doc Dot Org
https://godoc.org
BSD 3-Clause "New" or "Revised" License
1.1k stars 265 forks source link

Uses links are broken #511

Closed ghost closed 7 years ago

ghost commented 7 years ago
  1. Go to https://godoc.org/bytes
  2. Scroll to a function with a "Uses" link.
  3. Hover over function name to see "Uses" link and click.

Actual: sourcegraph 404 Expected: A page showing uses of the function.

dmitshur commented 7 years ago

/cc @sqs

slimsag commented 7 years ago

(Sourcegraph dev here) This issue has just been fixed.

I really appreciate the bug report, since it let us find and fix this. 😄

It was caused by a regression on our end that caused our Go language server to be unable to resolve symbols defined in the Go standard library.

I've confirmed this did not affect any other Go packages on godoc.org (only the standard library packages were affected), and am putting in place some better tests to ensure this doesn't happen again.

dmitshur commented 7 years ago

Thanks a lot for providing a quick resolution to this @slimsag, as well as explaining what happened.

I've confirmed that the Uses links for standard library identifiers work now, so this issue can be closed.

dmitshur commented 7 years ago

Reopening because this doesn't seem to be completely resolved, according to https://github.com/golang/go/issues/22067. In it, @dsnet said:

Go to the page for reflect.Copy. Hover the mouse to the right of the "func Copy" heading and click the "Uses" link. This link brings me to an error 404 page. The target it tries to hit is: https://sourcegraph.com/go/reflect/-/Copy, which reports the 404.

Interestingly, it works on the bytes.Compare. For example, "func Compare" links to the target: https://sourcegraph.com/-/godoc/refs?def=Compare&pkg=bytes&repo=, which does work.

/cc @slimsag @sqs

dmitshur commented 7 years ago

I tried refreshing the documentation of https://godoc.org/reflect package, but that had no effect on this.

slimsag commented 7 years ago

Thanks for re-opening & pinging @shurcooL ! I appreciate that. I've just fixed the mentioned issue.

This time the issue was a bit different: Sourcegraph doesn't yet have full support for type aliases.

Our Go language servers were running Go 1.8, and because of recent changes to the reflect package in the latest master revision of Go where type aliases had been added to the package tests, our language servers were failing to parse the reflect package properly.

I've fixed this by upgrading our language servers to Go 1.9, which means that any package with type aliases will now work.

Sorry for the trouble! If you notice any other issues please feel free to ping me or @sqs once again :)

dmitshur commented 7 years ago

Thanks for the update and resolving the issue once again, @slimsag.

I can confirm the uses link for reflect.Copy identifier works now. Closing, since this is resolved. /cc @dsnet