diff options
author | Aleksey Kladov <[email protected]> | 2019-11-15 20:24:56 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-15 20:24:56 +0000 |
commit | 4c90b7e2ecd03e739a3c92bbe5afd4c90fe2812d (patch) | |
tree | 3f95c69830b973c86362586dcbc25831996dfe98 /crates/ra_ide_api | |
parent | 1889b3c7b52c1070734dc449d4119c5e5cf991a4 (diff) |
Sourcify some things
If we want to support macros properly, we need to get rid of those
FileIds everywhere...
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/references/classify.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/runnables.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/references/classify.rs b/crates/ra_ide_api/src/references/classify.rs index 00690e449..b5e35e29f 100644 --- a/crates/ra_ide_api/src/references/classify.rs +++ b/crates/ra_ide_api/src/references/classify.rs | |||
@@ -144,8 +144,8 @@ pub(crate) fn classify_name_ref( | |||
144 | } | 144 | } |
145 | } | 145 | } |
146 | 146 | ||
147 | let ast = ModuleSource::from_child_node(db, file_id, &parent); | ||
148 | let file_id = file_id.into(); | 147 | let file_id = file_id.into(); |
148 | let ast = ModuleSource::from_child_node(db, Source::new(file_id, &parent)); | ||
149 | // FIXME: find correct container and visibility for each case | 149 | // FIXME: find correct container and visibility for each case |
150 | let container = Module::from_definition(db, Source { file_id, ast })?; | 150 | let container = Module::from_definition(db, Source { file_id, ast })?; |
151 | let visibility = None; | 151 | let visibility = None; |
diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide_api/src/runnables.rs index 366ac8048..8039a5164 100644 --- a/crates/ra_ide_api/src/runnables.rs +++ b/crates/ra_ide_api/src/runnables.rs | |||
@@ -1,5 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use hir::Source; | ||
3 | use itertools::Itertools; | 4 | use itertools::Itertools; |
4 | use ra_db::SourceDatabase; | 5 | use ra_db::SourceDatabase; |
5 | use ra_syntax::{ | 6 | use ra_syntax::{ |
@@ -65,9 +66,8 @@ fn runnable_mod(db: &RootDatabase, file_id: FileId, module: ast::Module) -> Opti | |||
65 | return None; | 66 | return None; |
66 | } | 67 | } |
67 | let range = module.syntax().text_range(); | 68 | let range = module.syntax().text_range(); |
68 | let src = hir::ModuleSource::from_child_node(db, file_id, &module.syntax()); | 69 | let src = hir::ModuleSource::from_child_node(db, Source::new(file_id.into(), &module.syntax())); |
69 | let module = | 70 | let module = hir::Module::from_definition(db, Source::new(file_id.into(), src))?; |
70 | hir::Module::from_definition(db, hir::Source { file_id: file_id.into(), ast: src })?; | ||
71 | 71 | ||
72 | let path = module.path_to_root(db).into_iter().rev().filter_map(|it| it.name(db)).join("::"); | 72 | let path = module.path_to_root(db).into_iter().rev().filter_map(|it| it.name(db)).join("::"); |
73 | Some(Runnable { range, kind: RunnableKind::TestMod { path } }) | 73 | Some(Runnable { range, kind: RunnableKind::TestMod { path } }) |