aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/syntax_highlighting.rs
blob: 65409beb20f93185074a725d7cc59d3c00d5da26 (plain)
1
2
3
4
5
6
7
8
9
10
11
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))
}