From b1332670c7c471a59f3da113b366e74ac194c38b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:12:04 +0200 Subject: Rename UseItem -> Use --- crates/ra_ide/src/completion/completion_context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index c84d43d77..cc55f6dd6 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -36,7 +36,7 @@ pub(crate) struct CompletionContext<'a> { pub(super) expected_type: Option, pub(super) name_ref_syntax: Option, pub(super) function_syntax: Option, - pub(super) use_item_syntax: Option, + pub(super) use_item_syntax: Option, pub(super) record_lit_syntax: Option, pub(super) record_pat_syntax: Option, pub(super) record_field_syntax: Option, @@ -343,7 +343,7 @@ impl<'a> CompletionContext<'a> { } self.use_item_syntax = - self.sema.ancestors_with_macros(self.token.parent()).find_map(ast::UseItem::cast); + self.sema.ancestors_with_macros(self.token.parent()).find_map(ast::Use::cast); self.function_syntax = self .sema -- cgit v1.2.3 From 1142112c70b705f59b7d559d9d72cdc831865158 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:51:08 +0200 Subject: Rename FnDef -> Fn --- crates/ra_ide/src/completion/completion_context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index cc55f6dd6..221d7847e 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -35,7 +35,7 @@ pub(crate) struct CompletionContext<'a> { pub(super) krate: Option, pub(super) expected_type: Option, pub(super) name_ref_syntax: Option, - pub(super) function_syntax: Option, + pub(super) function_syntax: Option, pub(super) use_item_syntax: Option, pub(super) record_lit_syntax: Option, pub(super) record_pat_syntax: Option, @@ -349,7 +349,7 @@ impl<'a> CompletionContext<'a> { .sema .ancestors_with_macros(self.token.parent()) .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) - .find_map(ast::FnDef::cast); + .find_map(ast::Fn::cast); self.record_field_syntax = self .sema -- cgit v1.2.3 From 6f8aa75329d0a4e588e58b8f22f7932bf3d3a706 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:21:30 +0200 Subject: Rename RecordLit -> RecordExpr --- crates/ra_ide/src/completion/completion_context.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 221d7847e..c8704eb3e 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -37,9 +37,9 @@ pub(crate) struct CompletionContext<'a> { pub(super) name_ref_syntax: Option, pub(super) function_syntax: Option, pub(super) use_item_syntax: Option, - pub(super) record_lit_syntax: Option, + pub(super) record_lit_syntax: Option, pub(super) record_pat_syntax: Option, - pub(super) record_field_syntax: Option, + pub(super) record_field_syntax: Option, pub(super) impl_def: Option, /// FIXME: `ActiveParameter` is string-based, which is very very wrong pub(super) active_parameter: Option, @@ -316,7 +316,7 @@ impl<'a> CompletionContext<'a> { self.name_ref_syntax = find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); let name_range = name_ref.syntax().text_range(); - if ast::RecordField::for_field_name(&name_ref).is_some() { + if ast::RecordExprField::for_field_name(&name_ref).is_some() { self.record_lit_syntax = self.sema.find_node_at_offset_with_macros(&original_file, offset); } @@ -357,7 +357,7 @@ impl<'a> CompletionContext<'a> { .take_while(|it| { it.kind() != SOURCE_FILE && it.kind() != MODULE && it.kind() != CALL_EXPR }) - .find_map(ast::RecordField::cast); + .find_map(ast::RecordExprField::cast); let parent = match name_ref.syntax().parent() { Some(it) => it, -- cgit v1.2.3 From c5798c4d75aa807aec47208a49101bdec3affcca Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:28:28 +0200 Subject: Finalize impl Grammar --- crates/ra_ide/src/completion/completion_context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index c8704eb3e..2113abbb2 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -40,7 +40,7 @@ pub(crate) struct CompletionContext<'a> { pub(super) record_lit_syntax: Option, pub(super) record_pat_syntax: Option, pub(super) record_field_syntax: Option, - pub(super) impl_def: Option, + pub(super) impl_def: Option, /// FIXME: `ActiveParameter` is string-based, which is very very wrong pub(super) active_parameter: Option, pub(super) is_param: bool, @@ -325,7 +325,7 @@ impl<'a> CompletionContext<'a> { .sema .ancestors_with_macros(self.token.parent()) .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) - .find_map(ast::ImplDef::cast); + .find_map(ast::Impl::cast); let top_node = name_ref .syntax() -- cgit v1.2.3 From 91781c7ce8201b28afd56b4e35eba47e076a8498 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 18:29:29 +0200 Subject: Rename TypeArgList -> GenericArgList --- crates/ra_ide/src/completion/completion_context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 2113abbb2..2a5f3c3d2 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -377,7 +377,7 @@ impl<'a> CompletionContext<'a> { path.syntax().parent().and_then(ast::TupleStructPat::cast).is_some(); self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some(); - self.has_type_args = segment.type_arg_list().is_some(); + self.has_type_args = segment.generic_arg_list().is_some(); #[allow(deprecated)] if let Some(path) = hir::Path::from_ast(path.clone()) { -- cgit v1.2.3 From 14cb96ec0e6be3b99bfe4ea373c058dcbd2a4f79 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 19:54:16 +0200 Subject: Allign RecordPat with RecordExpr --- crates/ra_ide/src/completion/completion_context.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 2a5f3c3d2..29955754c 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -265,7 +265,7 @@ impl<'a> CompletionContext<'a> { return; } // FIXME: remove this (V) duplication and make the check more precise - if name_ref.syntax().ancestors().find_map(ast::RecordFieldPatList::cast).is_some() { + if name_ref.syntax().ancestors().find_map(ast::RecordPatFieldList::cast).is_some() { self.record_pat_syntax = self.sema.find_node_at_offset_with_macros(&original_file, offset); } @@ -283,7 +283,7 @@ impl<'a> CompletionContext<'a> { { self.is_pat_binding_or_const = false; } - if bind_pat.syntax().parent().and_then(ast::RecordFieldPatList::cast).is_some() { + if bind_pat.syntax().parent().and_then(ast::RecordPatFieldList::cast).is_some() { self.is_pat_binding_or_const = false; } if let Some(let_stmt) = bind_pat.syntax().ancestors().find_map(ast::LetStmt::cast) { @@ -300,7 +300,7 @@ impl<'a> CompletionContext<'a> { return; } // FIXME: remove this (^) duplication and make the check more precise - if name.syntax().ancestors().find_map(ast::RecordFieldPatList::cast).is_some() { + if name.syntax().ancestors().find_map(ast::RecordPatFieldList::cast).is_some() { self.record_pat_syntax = self.sema.find_node_at_offset_with_macros(&original_file, offset); } -- cgit v1.2.3 From 98181087984157e27faba0b969e384f3c62c39d5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:09:09 +0200 Subject: Rename BindPat -> IdentPat --- crates/ra_ide/src/completion/completion_context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 29955754c..6b03b30bb 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -275,7 +275,7 @@ impl<'a> CompletionContext<'a> { // Otherwise, see if this is a declaration. We can use heuristics to // suggest declaration names, see `CompletionKind::Magic`. if let Some(name) = find_node_at_offset::(&file_with_fake_ident, offset) { - if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { + if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::IdentPat::cast) { self.is_pat_binding_or_const = true; if bind_pat.at_token().is_some() || bind_pat.ref_token().is_some() -- cgit v1.2.3