mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Semantic Ranges
This commit is contained in:
parent
d3040c0deb
commit
8f6f864547
6 changed files with 92 additions and 16 deletions
|
@ -430,6 +430,13 @@ impl Analysis {
|
|||
self.with_db(|db| syntax_highlighting::highlight(db, file_id))
|
||||
}
|
||||
|
||||
/// Computes syntax highlighting for the given file range.
|
||||
pub fn highlight_range(&self, frange: FileRange) -> Cancelable<Vec<HighlightedRange>> {
|
||||
self.with_db(|db| {
|
||||
syntax_highlighting::highlight_range(db, frange.file_id, Some(frange.range))
|
||||
})
|
||||
}
|
||||
|
||||
/// Computes syntax highlighting for the given file.
|
||||
pub fn highlight_as_html(&self, file_id: FileId, rainbow: bool) -> Cancelable<String> {
|
||||
self.with_db(|db| syntax_highlighting::highlight_as_html(db, file_id, rainbow))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue