-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add go-* shortcuts for various hard-to-find eglot operations #436
Comments
Do we also need to support lsp-mode or will they add their own functions? And if we only support eglot, should we name them |
Good question. Perhaps these functions shouldn't presume which LSP client is in use, but should query (waved hands vigorously) whether the buffer is managed by eglot or lsp-mode and take appropriate action. Much better that way than to include eglot in the symbol name; ideally most Emacs users wouldn't need to know anything about their LSP client. |
This change adds a new "Show free symbols" (source.freesymbols) code action that reports the set of free symbols referenced by the selected region of Go source. The HTML report, produced by the /freerefs endpoint of gopls' web server, includes an itemized list of symbols, and a color-annotated source listing. Symbols are presented in three groups: imported symbols (grouped by package); package-level symbols and local symbols. Each symbol is a link to either the integrated doc viewer (for imported symbols) or the declaration, for others. The feature is visible in editors as: - VS Code: Source actions... > Show free references - Emacs+eglot: M-x go-freesymbols (Requires (eglot--code-action go-freerefs "source.freesymbols") until dominikh/go-mode.el#436 is resolved.) There are a number of opportunities for factoring in common with RenderPackageDoc; they will be dealt with in a follow-up. Also: - a unit test of the freeRefs algorithm; - an integration test of the web interaction. - release notes. Change-Id: I97de76686fcc28e445a72e7c611673c47e467dfd Reviewed-on: https://go-review.googlesource.com/c/tools/+/539663 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]>
These four helper functions provide convenient ways to access gopls server functionality without the user needing to worry about how their LSP client does things. They should work for eglot and lsp-mode (though I haven't tested the latter). Updates dominikh/go-mode.el/dominikh#436
These four helper functions provide convenient ways to access gopls server functionality without the user needing to worry about how their LSP client does things. They should work for eglot and lsp-mode (though I haven't tested the latter). Updates dominikh/go-mode.el/dominikh#436
These four helper functions provide convenient ways to access gopls server functionality without the user needing to worry about how their LSP client does things. They should work for eglot and lsp-mode (though I haven't tested the latter). Updates dominikh/go-mode.el/dominikh#436
These four helper functions provide convenient ways to access gopls server functionality without the user needing to worry about how their LSP client does things. They should work for eglot and lsp-mode (though I haven't tested the latter). Updates dominikh/go-mode.el/#436
Could we add these declarations to go-mode.el to make it easier for Go programmers to find common operations whose eglot command is somewhat obscure?
[Edit: rename "freerefs" to "freesymbols"]
The text was updated successfully, but these errors were encountered: