aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/syntax_highlighting.rs
blob: 0bf19eea08869d031474872acc04cbd9af542f6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 source_file = db.source_file(file_id);
    let mut res = ra_editor::highlight(&source_file);
    for node in source_file.syntax().descendants() {}
    Ok(res)
}