aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-15 20:25:53 +0000
committerGitHub <[email protected]>2019-11-15 20:25:53 +0000
commit920848940ae7b79b1655ac48a9e2c1694b9e06c8 (patch)
treecd0d39cd13ae0a9ee7299db575bea1a854cc0102 /crates/ra_ide_api
parent86469d4195e7aeb93ae420d0c073593bfccc97f0 (diff)
parent4c90b7e2ecd03e739a3c92bbe5afd4c90fe2812d (diff)
Merge #2266
2266: Sourcify some things r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/references/classify.rs2
-rw-r--r--crates/ra_ide_api/src/runnables.rs6
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
3use hir::Source;
3use itertools::Itertools; 4use itertools::Itertools;
4use ra_db::SourceDatabase; 5use ra_db::SourceDatabase;
5use ra_syntax::{ 6use 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 } })