mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
introduce FromSource trait
This commit is contained in:
parent
c35ef7e1ed
commit
2867c40925
13 changed files with 294 additions and 138 deletions
|
@ -96,9 +96,8 @@ pub(crate) fn name_definition(
|
|||
|
||||
if let Some(module) = ast::Module::cast(parent.clone()) {
|
||||
if module.has_semi() {
|
||||
if let Some(child_module) =
|
||||
hir::source_binder::module_from_declaration(db, file_id, module)
|
||||
{
|
||||
let src = hir::Source { file_id: file_id.into(), ast: module };
|
||||
if let Some(child_module) = hir::Module::from_declaration(db, src) {
|
||||
let nav = NavigationTarget::from_module(db, child_module);
|
||||
return Some(vec![nav]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue