mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
move highlightning to a separate file
This commit is contained in:
parent
e80021cbd0
commit
dc496d0516
2 changed files with 14 additions and 2 deletions
12
crates/ra_analysis/src/syntax_highlighting.rs
Normal file
12
crates/ra_analysis/src/syntax_highlighting.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
use ra_editor::HighlightedRange;
|
||||
use ra_db::SyntaxDatabase;
|
||||
|
||||
use crate::{
|
||||
db::RootDatabase,
|
||||
FileId, Cancelable,
|
||||
};
|
||||
|
||||
pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> {
|
||||
let file = db.source_file(file_id);
|
||||
Ok(ra_editor::highlight(&file))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue