diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-23 19:25:35 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-23 19:25:35 +0100 |
commit | de87fe293e88e2b8785e1d90371ec4f274139454 (patch) | |
tree | 82f7e031b42d62d7b7f4ac3d238a2a9b76c532ac /crates/ra_ide_api | |
parent | afb792acb713442f1ad315354a9edfcdad0a5097 (diff) | |
parent | f6d2c3f9d57df896b56b3a1e3213e609cb12a81d (diff) |
Merge #1317
1317: profile highlighting r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/syntax_highlighting.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index 77c9ae3b1..7bba7a550 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs | |||
@@ -2,6 +2,7 @@ use rustc_hash::FxHashSet; | |||
2 | 2 | ||
3 | use ra_syntax::{ast, AstNode, TextRange, Direction, SyntaxKind, SyntaxKind::*, SyntaxElement, T}; | 3 | use ra_syntax::{ast, AstNode, TextRange, Direction, SyntaxKind, SyntaxKind::*, SyntaxElement, T}; |
4 | use ra_db::SourceDatabase; | 4 | use ra_db::SourceDatabase; |
5 | use ra_prof::profile; | ||
5 | 6 | ||
6 | use crate::{FileId, db::RootDatabase}; | 7 | use crate::{FileId, db::RootDatabase}; |
7 | 8 | ||
@@ -27,6 +28,8 @@ fn is_control_keyword(kind: SyntaxKind) -> bool { | |||
27 | } | 28 | } |
28 | 29 | ||
29 | pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRange> { | 30 | pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRange> { |
31 | let _p = profile("highlight"); | ||
32 | |||
30 | let source_file = db.parse(file_id); | 33 | let source_file = db.parse(file_id); |
31 | 34 | ||
32 | // Visited nodes to handle highlighting priorities | 35 | // Visited nodes to handle highlighting priorities |