diff options
author | Phil Ellison <[email protected]> | 2020-12-28 18:29:58 +0000 |
---|---|---|
committer | Phil Ellison <[email protected]> | 2020-12-28 18:29:58 +0000 |
commit | 077592a12fd982de3e69572a4c738dd4468617f9 (patch) | |
tree | 24bc738d02fb8c88ef662f85e4a0c9a4c8ab0fac /crates/ide/src/lib.rs | |
parent | 1d530756ed7ba175ec32ff71247072798dc9a748 (diff) |
Initial implementation of view-hir command
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r-- | crates/ide/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 41eb139d1..25c2047ca 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -31,6 +31,7 @@ mod folding_ranges; | |||
31 | mod goto_definition; | 31 | mod goto_definition; |
32 | mod goto_implementation; | 32 | mod goto_implementation; |
33 | mod goto_type_definition; | 33 | mod goto_type_definition; |
34 | mod view_hir; | ||
34 | mod hover; | 35 | mod hover; |
35 | mod inlay_hints; | 36 | mod inlay_hints; |
36 | mod join_lines; | 37 | mod join_lines; |
@@ -271,6 +272,10 @@ impl Analysis { | |||
271 | self.with_db(|db| syntax_tree::syntax_tree(&db, file_id, text_range)) | 272 | self.with_db(|db| syntax_tree::syntax_tree(&db, file_id, text_range)) |
272 | } | 273 | } |
273 | 274 | ||
275 | pub fn view_hir(&self, position: FilePosition) -> Cancelable<String> { | ||
276 | self.with_db(|db| view_hir::view_hir(&db, position)) | ||
277 | } | ||
278 | |||
274 | pub fn expand_macro(&self, position: FilePosition) -> Cancelable<Option<ExpandedMacro>> { | 279 | pub fn expand_macro(&self, position: FilePosition) -> Cancelable<Option<ExpandedMacro>> { |
275 | self.with_db(|db| expand_macro::expand_macro(db, position)) | 280 | self.with_db(|db| expand_macro::expand_macro(db, position)) |
276 | } | 281 | } |