Incoming call's hierarchy item's range is not usable as a point from which to start a new call hierarchy #17388
Labels
A-lsp
LSP conformance issues and missing features
A-third-party-client
C-support
Category: support questions
I am not sure if this should be a bug report or a feature request.
I have implemented call hierarchies in my client and only rust-analyzer is behaving counter to my expectations.
With the above file, here's what I am trying to achieve:
g()
on line 4, column 3. (lines and colums are 0-based)g()
is on line 9, column 12, coming from functionh()
.call_hierarchy_item.range
coversh
, but with rust-analyzer, the range is the whole function. That means that usingcall_hierarchy_item.range.start
for the nexttextDocument/prepareCallHierachy
request returns an empty response.Here's a link to asciinema showing how this works in the editor, with gopls server:
https://asciinema.org/a/NJRympD1YW7NvrHl9rT8uWCc7
Currently, this is what happens when I try to do the same with rust-analyzer:
https://asciinema.org/a/5vElc3tQ8q7UW2nW5QkP7stAJ
I have also attached rust-analyzer and ycmd log files.
Ideally, rust-analyzer would return a range that could be used for a susequent prepare hierarchy request.
If that is considereda breaking change, maybe a new config option would be doable?
Failing that, a custom extension to the call hierarchies? I wouldn't be thrilled about a server-specific behaviour, but crrently my only option is to prevent users from trying to "switch hierarchy direction" if they are in a rust file.
rust-analyzer version:
rust-analyzer 1.81.0-nightly (a70b2ae 2024-06-09)
rustc version:
rustc 1.81.0-nightly (a70b2ae57 2024-06-09)
editor or extension: Vim/YouCompleteMe
relevant settings: no settings were changed from the defaults
repository link (if public, optional): ycm-core/ycmd#1733
The text was updated successfully, but these errors were encountered: