aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/lib.rs
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-02-25 13:38:50 +0000
committerkjeremy <[email protected]>2020-02-25 16:37:43 +0000
commit8f6f864547bad3d2bb34ea0cf5a32e8adee58c4e (patch)
treead837a82e509a5aa8b4f69aa0288ba14d71b50cd /crates/ra_ide/src/lib.rs
parentd3040c0deba8266044029a6479a1c12c28e72750 (diff)
Semantic Ranges
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r--crates/ra_ide/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 82e10bc7e..c02bb08a0 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -430,6 +430,13 @@ impl Analysis {
430 self.with_db(|db| syntax_highlighting::highlight(db, file_id)) 430 self.with_db(|db| syntax_highlighting::highlight(db, file_id))
431 } 431 }
432 432
433 /// Computes syntax highlighting for the given file range.
434 pub fn highlight_range(&self, frange: FileRange) -> Cancelable<Vec<HighlightedRange>> {
435 self.with_db(|db| {
436 syntax_highlighting::highlight_range(db, frange.file_id, Some(frange.range))
437 })
438 }
439
433 /// Computes syntax highlighting for the given file. 440 /// Computes syntax highlighting for the given file.
434 pub fn highlight_as_html(&self, file_id: FileId, rainbow: bool) -> Cancelable<String> { 441 pub fn highlight_as_html(&self, file_id: FileId, rainbow: bool) -> Cancelable<String> {
435 self.with_db(|db| syntax_highlighting::highlight_as_html(db, file_id, rainbow)) 442 self.with_db(|db| syntax_highlighting::highlight_as_html(db, file_id, rainbow))