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_db/src | |
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 <aleksey.kladov@gmail.com>
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r-- | crates/ra_db/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 68b9a7143..7c49c585b 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -4,7 +4,7 @@ mod input; | |||
4 | 4 | ||
5 | use std::{panic, sync::Arc}; | 5 | use std::{panic, sync::Arc}; |
6 | 6 | ||
7 | use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc}; | 7 | use ra_syntax::{TextUnit, TextRange, SourceFile, Parse}; |
8 | use relative_path::RelativePathBuf; | 8 | use relative_path::RelativePathBuf; |
9 | use ra_prof::profile; | 9 | use ra_prof::profile; |
10 | 10 | ||
@@ -74,7 +74,7 @@ pub trait SourceDatabase: CheckCanceled + std::fmt::Debug { | |||
74 | fn file_text(&self, file_id: FileId) -> Arc<String>; | 74 | fn file_text(&self, file_id: FileId) -> Arc<String>; |
75 | // Parses the file into the syntax tree. | 75 | // Parses the file into the syntax tree. |
76 | #[salsa::invoke(parse_query)] | 76 | #[salsa::invoke(parse_query)] |
77 | fn parse(&self, file_id: FileId) -> TreeArc<SourceFile>; | 77 | fn parse(&self, file_id: FileId) -> Parse; |
78 | /// Path to a file, relative to the root of its source root. | 78 | /// Path to a file, relative to the root of its source root. |
79 | #[salsa::input] | 79 | #[salsa::input] |
80 | fn file_relative_path(&self, file_id: FileId) -> RelativePathBuf; | 80 | fn file_relative_path(&self, file_id: FileId) -> RelativePathBuf; |
@@ -98,7 +98,7 @@ fn source_root_crates(db: &impl SourceDatabase, id: SourceRootId) -> Arc<Vec<Cra | |||
98 | Arc::new(res) | 98 | Arc::new(res) |
99 | } | 99 | } |
100 | 100 | ||
101 | fn parse_query(db: &impl SourceDatabase, file_id: FileId) -> TreeArc<SourceFile> { | 101 | fn parse_query(db: &impl SourceDatabase, file_id: FileId) -> Parse { |
102 | let _p = profile("parse_query"); | 102 | let _p = profile("parse_query"); |
103 | let text = db.file_text(file_id); | 103 | let text = db.file_text(file_id); |
104 | SourceFile::parse(&*text) | 104 | SourceFile::parse(&*text) |