aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-05 17:02:19 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-05 17:02:19 +0100
commit3ea25a66a8deab9e20654dbc8d2bf07df2cbb6f8 (patch)
tree0bd7f6aba3d7486fc0e99437888792b572532010
parent9c302980e386734472f9bae50a0db59247cba623 (diff)
parent7e7ea0e79dc70fc45aa2bf51f210aaaaf2208060 (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]>
-rw-r--r--crates/ra_ide_api/src/diagnostics.rs2
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};
10use ra_text_edit::{TextEdit, TextEditBuilder}; 10use ra_text_edit::{TextEdit, TextEditBuilder};
11use ra_prof::profile;
11 12
12use crate::{Diagnostic, FileId, FileSystemEdit, SourceChange, SourceFileEdit, db::RootDatabase}; 13use crate::{Diagnostic, FileId, FileSystemEdit, SourceChange, SourceFileEdit, db::RootDatabase};
13 14
@@ -18,6 +19,7 @@ pub enum Severity {
18} 19}
19 20
20pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic> { 21pub(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