diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-06 14:01:07 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-06 14:01:07 +0000 |
commit | f6cf9393a8327b4c0385bccbc5be84a79bd50057 (patch) | |
tree | 4af15c8906b85de01a15c717bc1fac388952cd3d /crates/ra_ide_api/src/imp.rs | |
parent | 736a55c97e69f95e6ff4a0c3dafb2018e8ea05f9 (diff) | |
parent | 0c5fd8f7cbf04eda763e55bc9a38dad5f7ec917d (diff) |
Merge #750
750: Move assists to a separate crate r=matklad a=matklad
I am slowly coming to conclusion that ide_api_light does not make a lot of sense after all :D
This PR moves assists to a separate crate, so that assists can use database (so, inspect types, do name-resolution, etc)
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/imp.rs')
-rw-r--r-- | crates/ra_ide_api/src/imp.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs index fd8637ad2..b139efabf 100644 --- a/crates/ra_ide_api/src/imp.rs +++ b/crates/ra_ide_api/src/imp.rs | |||
@@ -19,7 +19,7 @@ use ra_syntax::{ | |||
19 | 19 | ||
20 | use crate::{ | 20 | use crate::{ |
21 | AnalysisChange, | 21 | AnalysisChange, |
22 | CrateId, db, Diagnostic, FileId, FilePosition, FileRange, FileSystemEdit, | 22 | CrateId, db, Diagnostic, FileId, FilePosition, FileSystemEdit, |
23 | Query, RootChange, SourceChange, SourceFileEdit, | 23 | Query, RootChange, SourceChange, SourceFileEdit, |
24 | symbol_index::{FileSymbol, SymbolsDatabase}, | 24 | symbol_index::{FileSymbol, SymbolsDatabase}, |
25 | status::syntax_tree_stats | 25 | status::syntax_tree_stats |
@@ -236,15 +236,6 @@ impl db::RootDatabase { | |||
236 | res | 236 | res |
237 | } | 237 | } |
238 | 238 | ||
239 | pub(crate) fn assists(&self, frange: FileRange) -> Vec<SourceChange> { | ||
240 | let file = self.parse(frange.file_id); | ||
241 | ra_ide_api_light::assists::assists(&file, frange.range) | ||
242 | .into_iter() | ||
243 | .chain(crate::assists::assists(self, frange.file_id, &file, frange.range).into_iter()) | ||
244 | .map(|local_edit| SourceChange::from_local_edit(frange.file_id, local_edit)) | ||
245 | .collect() | ||
246 | } | ||
247 | |||
248 | pub(crate) fn index_resolve(&self, name_ref: &ast::NameRef) -> Vec<FileSymbol> { | 239 | pub(crate) fn index_resolve(&self, name_ref: &ast::NameRef) -> Vec<FileSymbol> { |
249 | let name = name_ref.text(); | 240 | let name = name_ref.text(); |
250 | let mut query = Query::new(name.to_string()); | 241 | let mut query = Query::new(name.to_string()); |