aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand
diff options
context:
space:
mode:
authorBenjamin Coenen <[email protected]>2020-04-11 21:54:22 +0100
committerBenjamin Coenen <[email protected]>2020-04-11 22:45:09 +0100
commit93bfc2d05d36a47dc05a1799210327473d702dbc (patch)
treedee25e78b24b5d1b23d73ae1009bddbd060927cf /crates/ra_hir_expand
parentd42346fed61f706d68fe888631a41ea5f2752d7f (diff)
parentfd06fe7b13045185ab4e630b0044aa9d8bbcdf8a (diff)
Improve autocompletion by looking on the type and name
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r--crates/ra_hir_expand/src/ast_id_map.rs2
-rw-r--r--crates/ra_hir_expand/src/quote.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_expand/src/ast_id_map.rs b/crates/ra_hir_expand/src/ast_id_map.rs
index 5643ecdce..a3ca302c2 100644
--- a/crates/ra_hir_expand/src/ast_id_map.rs
+++ b/crates/ra_hir_expand/src/ast_id_map.rs
@@ -90,7 +90,7 @@ impl AstIdMap {
90 } 90 }
91 91
92 pub(crate) fn get<N: AstNode>(&self, id: FileAstId<N>) -> AstPtr<N> { 92 pub(crate) fn get<N: AstNode>(&self, id: FileAstId<N>) -> AstPtr<N> {
93 self.arena[id.raw].cast::<N>().unwrap() 93 self.arena[id.raw].clone().cast::<N>().unwrap()
94 } 94 }
95 95
96 fn alloc(&mut self, item: &SyntaxNode) -> ErasedFileAstId { 96 fn alloc(&mut self, item: &SyntaxNode) -> ErasedFileAstId {
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs
index 3fd4233da..219bc2097 100644
--- a/crates/ra_hir_expand/src/quote.rs
+++ b/crates/ra_hir_expand/src/quote.rs
@@ -232,7 +232,7 @@ mod tests {
232 let quoted = quote!(#a); 232 let quoted = quote!(#a);
233 assert_eq!(quoted.to_string(), "hello"); 233 assert_eq!(quoted.to_string(), "hello");
234 let t = format!("{:?}", quoted); 234 let t = format!("{:?}", quoted);
235 assert_eq!(t, "Subtree { delimiter: None, token_trees: [Leaf(Ident(Ident { text: \"hello\", id: TokenId(4294967295) }))] }"); 235 assert_eq!(t, "SUBTREE $\n IDENT hello 4294967295");
236 } 236 }
237 237
238 #[test] 238 #[test]