diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-18 21:19:35 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-18 21:19:35 +0100 |
commit | 58d4983ba5745975446d60f2886d96f8d2adf0f2 (patch) | |
tree | 2336c03a0eeef98ac375868bd27dfe7e50668869 /crates/ra_db/src/lib.rs | |
parent | abe72424a647a31840eb952d42905f83628a623c (diff) | |
parent | df33e7685bdb0f63bf6aa809b9046708d563a1a7 (diff) |
Merge #1548
1548: use Parse in mbe r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_db/src/lib.rs')
-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 11e18a03d..b82d1bda0 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -5,7 +5,7 @@ mod input; | |||
5 | use std::{panic, sync::Arc}; | 5 | use std::{panic, sync::Arc}; |
6 | 6 | ||
7 | use ra_prof::profile; | 7 | use ra_prof::profile; |
8 | use ra_syntax::{Parse, SourceFile, TextRange, TextUnit}; | 8 | use ra_syntax::{ast, Parse, SourceFile, TextRange, TextUnit}; |
9 | use relative_path::RelativePathBuf; | 9 | use relative_path::RelativePathBuf; |
10 | 10 | ||
11 | pub use crate::{ | 11 | pub use crate::{ |
@@ -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) -> Parse; | 77 | fn parse(&self, file_id: FileId) -> Parse<ast::SourceFile>; |
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) -> Parse { | 101 | fn parse_query(db: &impl SourceDatabase, file_id: FileId) -> Parse<ast::SourceFile> { |
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) |