aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-18 21:19:35 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-18 21:19:35 +0100
commit58d4983ba5745975446d60f2886d96f8d2adf0f2 (patch)
tree2336c03a0eeef98ac375868bd27dfe7e50668869 /crates/ra_db/src/lib.rs
parentabe72424a647a31840eb952d42905f83628a623c (diff)
parentdf33e7685bdb0f63bf6aa809b9046708d563a1a7 (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.rs6
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;
5use std::{panic, sync::Arc}; 5use std::{panic, sync::Arc};
6 6
7use ra_prof::profile; 7use ra_prof::profile;
8use ra_syntax::{Parse, SourceFile, TextRange, TextUnit}; 8use ra_syntax::{ast, Parse, SourceFile, TextRange, TextUnit};
9use relative_path::RelativePathBuf; 9use relative_path::RelativePathBuf;
10 10
11pub use crate::{ 11pub 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
101fn parse_query(db: &impl SourceDatabase, file_id: FileId) -> Parse { 101fn 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)