diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-29 07:40:39 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-29 07:40:39 +0100 |
commit | 7a1cae59acf72f821343b2ba10ef69fb92a5b952 (patch) | |
tree | 26e606ccd132a24e9bc89cf174e4adadf60c5992 /crates/ra_ide_api/src/status.rs | |
parent | b0d84cb8faefedde7ace4ff152a2a13408e79e5d (diff) | |
parent | 80a17251473bd6213a4c8a51ea7f732394d173c5 (diff) |
Merge #1337
1337: Move syntax errors our of syntax tree r=matklad a=matklad
I am not really sure if it's a good idea, but `SyntaxError` do not really belong to a `SyntaxTree`. So let's just store them on the side?
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/status.rs')
-rw-r--r-- | crates/ra_ide_api/src/status.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs index d99a4e750..821106fea 100644 --- a/crates/ra_ide_api/src/status.rs +++ b/crates/ra_ide_api/src/status.rs | |||
@@ -4,7 +4,7 @@ use std::{ | |||
4 | sync::Arc, | 4 | sync::Arc, |
5 | }; | 5 | }; |
6 | 6 | ||
7 | use ra_syntax::{AstNode, TreeArc, SourceFile}; | 7 | use ra_syntax::{AstNode, Parse}; |
8 | use ra_db::{ | 8 | use ra_db::{ |
9 | ParseQuery, FileTextQuery, SourceRootId, | 9 | ParseQuery, FileTextQuery, SourceRootId, |
10 | salsa::{Database, debug::{DebugQueryTable, TableEntry}}, | 10 | salsa::{Database, debug::{DebugQueryTable, TableEntry}}, |
@@ -72,17 +72,17 @@ impl fmt::Display for SyntaxTreeStats { | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | impl FromIterator<TableEntry<FileId, TreeArc<SourceFile>>> for SyntaxTreeStats { | 75 | impl FromIterator<TableEntry<FileId, Parse>> for SyntaxTreeStats { |
76 | fn from_iter<T>(iter: T) -> SyntaxTreeStats | 76 | fn from_iter<T>(iter: T) -> SyntaxTreeStats |
77 | where | 77 | where |
78 | T: IntoIterator<Item = TableEntry<FileId, TreeArc<SourceFile>>>, | 78 | T: IntoIterator<Item = TableEntry<FileId, Parse>>, |
79 | { | 79 | { |
80 | let mut res = SyntaxTreeStats::default(); | 80 | let mut res = SyntaxTreeStats::default(); |
81 | for entry in iter { | 81 | for entry in iter { |
82 | res.total += 1; | 82 | res.total += 1; |
83 | if let Some(value) = entry.value { | 83 | if let Some(value) = entry.value { |
84 | res.retained += 1; | 84 | res.retained += 1; |
85 | res.retained_size += value.syntax().memory_size_of_subtree(); | 85 | res.retained_size += value.tree.syntax().memory_size_of_subtree(); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | res | 88 | res |