diff options
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r-- | crates/ra_ide/src/lib.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 82e10bc7e..d509de14e 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -35,7 +35,6 @@ mod typing; | |||
35 | mod matching_brace; | 35 | mod matching_brace; |
36 | mod display; | 36 | mod display; |
37 | mod inlay_hints; | 37 | mod inlay_hints; |
38 | mod expand; | ||
39 | mod expand_macro; | 38 | mod expand_macro; |
40 | mod ssr; | 39 | mod 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::{tags, HighlightedRange}, | 77 | syntax_highlighting::{ |
78 | Highlight, HighlightModifier, HighlightModifiers, HighlightTag, HighlightedRange, | ||
79 | }, | ||
79 | }; | 80 | }; |
80 | 81 | ||
81 | pub use hir::Documentation; | 82 | pub 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. |