You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a feature request to add a command-line flag to change the prefix of the URLs generated for source declarations.
For example, when I run pkgsite in a local clone of the kubernetes repo, by clicking around on the API documentation for a package, I can reach this URL:
In particular, the prefix http://localhost:12345/something/ would be an endpoint served by a local gopls instance, and visiting that URL would cause gopls to send a showDocument request to the user's editor to open the named file and line. In this way, the pkgsite browser pane and the user's editor can link to each other, enabling a lightweight interactive process for reviewing API documentation even as the files are being edited.
(A related feature request would be the ability to specify "overlays" of unsaved editor buffers that pkgsite would use instead of the file system, but I suspect that's rather harder. It would allow even unsaved doc edits to be previewed.)
The text was updated successfully, but these errors were encountered:
Having inspected the pkgsite code a little, I think the cleanest seam would be for the Server.InstallFS operation to install an alternative handler when the -files_redirect=http://localhost:12345/something flag is set, and this handler would issue an HTTP redirect to "http://localhost:12345/something" + req.URL.Path. That way all the places that construct /files URLs can be left unchanged, and just the endpoint that handles them will differ.
I think it will be simpler overall for gopls to implement its own rendering. Code sharing would be complex for both parties, and the total amount of code gopls requires is really not very much. Having its own implementation will make it easier to evolve, for example to include type-derived information, which is of course not available to pkgsite.
This issue is a feature request to add a command-line flag to change the prefix of the URLs generated for source declarations.
For example, when I run pkgsite in a local clone of the kubernetes repo, by clicking around on the API documentation for a package, I can reach this URL:
http://localhost:8080/files/Users/adonovan/w/kubernetes/k8s.io/kubernetes/pkg/api/endpoints/testing/make.go#L53
I would like to be able to run pkgsite in a mode in which this link instead goes to:
http://localhost:12345/something/Users/adonovan/w/kubernetes/k8s.io/kubernetes/pkg/api/endpoints/testing/make.go#L53
In particular, the prefix
http://localhost:12345/something/
would be an endpoint served by a local gopls instance, and visiting that URL would cause gopls to send a showDocument request to the user's editor to open the named file and line. In this way, the pkgsite browser pane and the user's editor can link to each other, enabling a lightweight interactive process for reviewing API documentation even as the files are being edited.(A related feature request would be the ability to specify "overlays" of unsaved editor buffers that pkgsite would use instead of the file system, but I suspect that's rather harder. It would allow even unsaved doc edits to be previewed.)
The text was updated successfully, but these errors were encountered: