aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r--crates/ra_ide/src/lib.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index f86f98be7..d509de14e 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -35,7 +35,6 @@ mod typing;
35mod matching_brace; 35mod matching_brace;
36mod display; 36mod display;
37mod inlay_hints; 37mod inlay_hints;
38mod expand;
39mod expand_macro; 38mod expand_macro;
40mod ssr; 39mod ssr;
41 40
@@ -75,7 +74,9 @@ pub use crate::{
75 runnables::{Runnable, RunnableKind, TestId}, 74 runnables::{Runnable, RunnableKind, TestId},
76 source_change::{FileSystemEdit, SourceChange, SourceFileEdit}, 75 source_change::{FileSystemEdit, SourceChange, SourceFileEdit},
77 ssr::SsrError, 76 ssr::SsrError,
78 syntax_highlighting::HighlightedRange, 77 syntax_highlighting::{
78 Highlight, HighlightModifier, HighlightModifiers, HighlightTag, HighlightedRange,
79 },
79}; 80};
80 81
81pub use hir::Documentation; 82pub use hir::Documentation;
@@ -319,9 +320,7 @@ impl Analysis {
319 file_id: FileId, 320 file_id: FileId,
320 max_inlay_hint_length: Option<usize>, 321 max_inlay_hint_length: Option<usize>,
321 ) -> Cancelable<Vec<InlayHint>> { 322 ) -> Cancelable<Vec<InlayHint>> {
322 self.with_db(|db| { 323 self.with_db(|db| inlay_hints::inlay_hints(db, file_id, max_inlay_hint_length))
323 inlay_hints::inlay_hints(db, file_id, &db.parse(file_id).tree(), max_inlay_hint_length)
324 })
325 } 324 }
326 325
327 /// Returns the set of folding ranges. 326 /// Returns the set of folding ranges.
@@ -425,9 +424,14 @@ impl Analysis {
425 self.with_db(|db| runnables::runnables(db, file_id)) 424 self.with_db(|db| runnables::runnables(db, file_id))
426 } 425 }
427 426
428 /// Computes syntax highlighting for the given file. 427 /// Computes syntax highlighting for the given file
429 pub fn highlight(&self, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> { 428 pub fn highlight(&self, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> {
430 self.with_db(|db| syntax_highlighting::highlight(db, file_id)) 429 self.with_db(|db| syntax_highlighting::highlight(db, file_id, None))
430 }
431
432 /// Computes syntax highlighting for the given file range.
433 pub fn highlight_range(&self, frange: FileRange) -> Cancelable<Vec<HighlightedRange>> {
434 self.with_db(|db| syntax_highlighting::highlight(db, frange.file_id, Some(frange.range)))
431 } 435 }
432 436
433 /// Computes syntax highlighting for the given file. 437 /// Computes syntax highlighting for the given file.