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:
Aleksey Kladov 2019-12-20 11:30:22 +01:00
parent d316ba9a13
commit 67c2aea182

View file

@ -212,10 +212,9 @@ 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 {
@ -252,3 +251,4 @@ fn _analyze_container(db: &impl DefDatabase, src: InFile<&SyntaxNode>) -> Option
let c = Module::from_definition(db, src.with_value(module_source))?; let c = Module::from_definition(db, src.with_value(module_source))?;
Some(c.id.child_by_source(db)) Some(c.id.child_by_source(db))
} }
}