diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-05 17:02:19 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-05 17:02:19 +0100 |
commit | 3ea25a66a8deab9e20654dbc8d2bf07df2cbb6f8 (patch) | |
tree | 0bd7f6aba3d7486fc0e99437888792b572532010 /crates/ra_ide_api | |
parent | 9c302980e386734472f9bae50a0db59247cba623 (diff) | |
parent | 7e7ea0e79dc70fc45aa2bf51f210aaaaf2208060 (diff) |
Merge #1245
1245: Add profiling to diagnostics r=matklad a=marcogroppo
Add profiling to `diagnostics()` - see #1244.
Co-authored-by: Marco Groppo <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/diagnostics.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs index 2dfaa0045..b27cb690a 100644 --- a/crates/ra_ide_api/src/diagnostics.rs +++ b/crates/ra_ide_api/src/diagnostics.rs | |||
@@ -8,6 +8,7 @@ use ra_syntax::{ | |||
8 | ast::{self, AstNode}, | 8 | ast::{self, AstNode}, |
9 | }; | 9 | }; |
10 | use ra_text_edit::{TextEdit, TextEditBuilder}; | 10 | use ra_text_edit::{TextEdit, TextEditBuilder}; |
11 | use ra_prof::profile; | ||
11 | 12 | ||
12 | use crate::{Diagnostic, FileId, FileSystemEdit, SourceChange, SourceFileEdit, db::RootDatabase}; | 13 | use crate::{Diagnostic, FileId, FileSystemEdit, SourceChange, SourceFileEdit, db::RootDatabase}; |
13 | 14 | ||
@@ -18,6 +19,7 @@ pub enum Severity { | |||
18 | } | 19 | } |
19 | 20 | ||
20 | pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic> { | 21 | pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic> { |
22 | let _p = profile("diagnostics"); | ||
21 | let source_file = db.parse(file_id); | 23 | let source_file = db.parse(file_id); |
22 | let mut res = Vec::new(); | 24 | let mut res = Vec::new(); |
23 | 25 | ||