diff --git a/crates/libeditor/src/completion.rs b/crates/libeditor/src/completion.rs index f3058c0231..be37fb6bf2 100644 --- a/crates/libeditor/src/completion.rs +++ b/crates/libeditor/src/completion.rs @@ -42,6 +42,7 @@ pub fn scope_completion(file: &File, offset: TextUnit) -> Option; + ", r#"[]"#); + } + #[test] fn test_complete_type() { check_scope_completion(r" diff --git a/crates/libeditor/src/scope/mod_scope.rs b/crates/libeditor/src/scope/mod_scope.rs index 052f70569c..67baa8678e 100644 --- a/crates/libeditor/src/scope/mod_scope.rs +++ b/crates/libeditor/src/scope/mod_scope.rs @@ -1,5 +1,5 @@ use libsyntax2::{ - AstNode, SyntaxNode, SmolStr, ast + AstNode, SyntaxNode, SyntaxNodeRef, SmolStr, ast }; pub struct ModuleScope { @@ -67,6 +67,9 @@ impl Entry { .text(), } } + pub fn syntax(&self) -> SyntaxNodeRef { + self.node.borrowed() + } } fn collect_imports(tree: ast::UseTree, acc: &mut Vec) {