mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Merge #7068
7068: Add VSCode command to view the hir of a function body r=theotherphil a=theotherphil Will fix https://github.com/rust-analyzer/rust-analyzer/issues/7061. Very rough initial version just to work out where I needed to wire everything up. @matklad would you be happy merging a hir visualiser of some kind? If so, do you have any thoughts on what you'd like it show, and how? I've spent very little time on this thus far, so I'm fine with throwing away the contents of this PR, but I want to avoid taking the time to make this more polished/interactive/useful only to discover that no-one else has any interest in this functionality.  Co-authored-by: Phil Ellison <phil.j.ellison@gmail.com>
This commit is contained in:
commit
1cc73d60bb
12 changed files with 143 additions and 2 deletions
|
@ -31,6 +31,7 @@ mod folding_ranges;
|
|||
mod goto_definition;
|
||||
mod goto_implementation;
|
||||
mod goto_type_definition;
|
||||
mod view_hir;
|
||||
mod hover;
|
||||
mod inlay_hints;
|
||||
mod join_lines;
|
||||
|
@ -271,6 +272,10 @@ impl Analysis {
|
|||
self.with_db(|db| syntax_tree::syntax_tree(&db, file_id, text_range))
|
||||
}
|
||||
|
||||
pub fn view_hir(&self, position: FilePosition) -> Cancelable<String> {
|
||||
self.with_db(|db| view_hir::view_hir(&db, position))
|
||||
}
|
||||
|
||||
pub fn expand_macro(&self, position: FilePosition) -> Cancelable<Option<ExpandedMacro>> {
|
||||
self.with_db(|db| expand_macro::expand_macro(db, position))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue