-
Notifications
You must be signed in to change notification settings - Fork 184
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
Implement call hierarchy request #2151
Conversation
Nice! |
This comment was marked as resolved.
This comment was marked as resolved.
The first item is expanded now, and I added a toggle button to switch between incoming / outgoing calls. Not sure what's going on with the CI. The lint errors seem to be completely unrelated to this PR. But I don't get those errors on the main branch... |
Oh, I see. I think it uses the code font for these characters, i.e. the font you configured in Preferences.sublime-settings. And it seems those characters are not supported by this font. I guess we can try to set the "system" font for them, and then see if the arrows are rendered correctly.
Yeah I had this in mind already, but haven't tried it yet. I wonder whether there is a way to open the new tab to the left of the "Call Hierarchy" sheet. So that the call hierarchy sheet will always be the rightmost tab. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
General note: The "Incoming" / "Outgoing" naming from the spec is IMO not very easy to understand. I think we could adopt the VSCode naming which uses "Callers of" / "Calls from". |
(BTW. Adding support for Call Hierarchy in typescript-language-server/typescript-language-server#649 also) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are OK with this approach, it would be nice if you could also add some bits about it to documentation (at least the new command name) and maybe add to main menu if relevant to you.
boot.py
Outdated
@@ -190,27 +195,39 @@ def on_post_window_command(self, window: sublime.Window, command_name: str, args | |||
sublime.set_timeout(panel_manager.update_log_panel) | |||
|
|||
|
|||
class LspOpenLocationCommand(sublime_plugin.TextCommand): | |||
class LspOpenLocationCommand(LspWindowCommand): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found two places that ran this command on the view:
- https://github.com/sublimelsp/LSP-volar/blob/32f0c42ecf2d10036a913518938a91d704c809f1/plugin.py#L69-L69
- https://github.com/sublimelsp/LSP-typescript/blob/e6ae40de6c3322fbe064698ff49f958ab6b3e4f9/commands.py#L35-L35
Not a priority but we should remember to fix those around the same time.
* main: workaround for View Listeners not being attached for new transient view (sublimelsp#2174) Make Document Symbols behavior more consistent with built-in Goto Symbol (sublimelsp#2166) docs: fsautocomplete config - remove redundant argument (sublimelsp#2165) Allow missing window/workDoneProgress/create request from the server (sublimelsp#2159) Use "plaintext" language ID for plain text files (sublimelsp#2164) Improve type annotations (sublimelsp#2162) Don't use "escapeall" extension when formatting with mdpopups (sublimelsp#2163)
* main: (80 commits) Perform inlay hint action on double instead of single click (#2175) support canceling pending completions request (#2177) Implement type hierarchy request (#2180) fix stale state or lack of updates on changing branches (#2182) Add timestamp and request duration in LSP logs (#2181) don't show diagnostics panel on save by default (#2179) trigger "on_server_response_async" also for "initialize" response (#2172) feat(API): allow setting additional text in permanent server status (#2173) Implement call hierarchy request (#2151) workaround for View Listeners not being attached for new transient view (#2174) Make Document Symbols behavior more consistent with built-in Goto Symbol (#2166) docs: fsautocomplete config - remove redundant argument (#2165) Allow missing window/workDoneProgress/create request from the server (#2159) Use "plaintext" language ID for plain text files (#2164) Improve type annotations (#2162) Don't use "escapeall" extension when formatting with mdpopups (#2163) Cut 1.21.0 Fix inlay hint parts wrapping into multiple lines (#2153) Ensure commands triggered from minihtml run on correct view (#2154) Add "Source Action" entry to the "Edit" main menu (#2149) ...
There is no Sublime API to visualize and interact with a tree structure, like for example the folders and files in the sidebar. So I made my own implementation for that, using a HtmlSheet. Let me know what you think!
It can be tested e.g. with LSP-pyright:
call_hierarchy.webm
For now only with "incoming calls" (which is quite similar to "Find References"), but just due to lack of a good solution how a toggle or so can be represented in the UI. VSCode has a small button to change between incoming/outgoing calls.The "TreeView" is a quite generic implementation (inspired by the VSCode API). So it should be straightforward to reuse it for the "type hierarchy" request, but I haven't tested that because I don't know which language server supports type hierarchy requests.
Closes #1429.