mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Rebuild ra_lsp_server and nest helper function.
Completion now works again, so there's no need not to nest
This commit is contained in:
parent
d316ba9a13
commit
67c2aea182
1 changed files with 37 additions and 37 deletions
|
@ -212,43 +212,43 @@ impl Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn analyze_container(db: &impl DefDatabase, src: InFile<&SyntaxNode>) -> DynMap {
|
fn analyze_container(db: &impl DefDatabase, src: InFile<&SyntaxNode>) -> DynMap {
|
||||||
_analyze_container(db, src).unwrap_or_default()
|
return child_by_source(db, src).unwrap_or_default();
|
||||||
}
|
|
||||||
|
|
||||||
fn _analyze_container(db: &impl DefDatabase, src: InFile<&SyntaxNode>) -> Option<DynMap> {
|
fn child_by_source(db: &impl DefDatabase, src: InFile<&SyntaxNode>) -> Option<DynMap> {
|
||||||
for container in src.value.ancestors().skip(1) {
|
for container in src.value.ancestors().skip(1) {
|
||||||
let res = match_ast! {
|
let res = match_ast! {
|
||||||
match container {
|
match container {
|
||||||
ast::TraitDef(it) => {
|
ast::TraitDef(it) => {
|
||||||
let def = Trait::from_source(db, src.with_value(it))?;
|
let def = Trait::from_source(db, src.with_value(it))?;
|
||||||
def.id.child_by_source(db)
|
def.id.child_by_source(db)
|
||||||
},
|
},
|
||||||
ast::ImplBlock(it) => {
|
ast::ImplBlock(it) => {
|
||||||
let def = ImplBlock::from_source(db, src.with_value(it))?;
|
let def = ImplBlock::from_source(db, src.with_value(it))?;
|
||||||
def.id.child_by_source(db)
|
def.id.child_by_source(db)
|
||||||
},
|
},
|
||||||
ast::FnDef(it) => {
|
ast::FnDef(it) => {
|
||||||
let def = Function::from_source(db, src.with_value(it))?;
|
let def = Function::from_source(db, src.with_value(it))?;
|
||||||
DefWithBodyId::from(def.id)
|
DefWithBodyId::from(def.id)
|
||||||
.child_by_source(db)
|
.child_by_source(db)
|
||||||
},
|
},
|
||||||
ast::StaticDef(it) => {
|
ast::StaticDef(it) => {
|
||||||
let def = Static::from_source(db, src.with_value(it))?;
|
let def = Static::from_source(db, src.with_value(it))?;
|
||||||
DefWithBodyId::from(def.id)
|
DefWithBodyId::from(def.id)
|
||||||
.child_by_source(db)
|
.child_by_source(db)
|
||||||
},
|
},
|
||||||
ast::ConstDef(it) => {
|
ast::ConstDef(it) => {
|
||||||
let def = Const::from_source(db, src.with_value(it))?;
|
let def = Const::from_source(db, src.with_value(it))?;
|
||||||
DefWithBodyId::from(def.id)
|
DefWithBodyId::from(def.id)
|
||||||
.child_by_source(db)
|
.child_by_source(db)
|
||||||
},
|
},
|
||||||
_ => { continue },
|
_ => { continue },
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return Some(res);
|
return Some(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
let module_source = ModuleSource::from_child_node(db, src);
|
||||||
|
let c = Module::from_definition(db, src.with_value(module_source))?;
|
||||||
|
Some(c.id.child_by_source(db))
|
||||||
}
|
}
|
||||||
|
|
||||||
let module_source = ModuleSource::from_child_node(db, src);
|
|
||||||
let c = Module::from_definition(db, src.with_value(module_source))?;
|
|
||||||
Some(c.id.child_by_source(db))
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue