diff options
Diffstat (limited to 'crates/ra_ide/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index c84d43d77..2113abbb2 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -35,12 +35,12 @@ pub(crate) struct CompletionContext<'a> { | |||
35 | pub(super) krate: Option<hir::Crate>, | 35 | pub(super) krate: Option<hir::Crate>, |
36 | pub(super) expected_type: Option<Type>, | 36 | pub(super) expected_type: Option<Type>, |
37 | pub(super) name_ref_syntax: Option<ast::NameRef>, | 37 | pub(super) name_ref_syntax: Option<ast::NameRef>, |
38 | pub(super) function_syntax: Option<ast::FnDef>, | 38 | pub(super) function_syntax: Option<ast::Fn>, |
39 | pub(super) use_item_syntax: Option<ast::UseItem>, | 39 | pub(super) use_item_syntax: Option<ast::Use>, |
40 | pub(super) record_lit_syntax: Option<ast::RecordLit>, | 40 | pub(super) record_lit_syntax: Option<ast::RecordExpr>, |
41 | pub(super) record_pat_syntax: Option<ast::RecordPat>, | 41 | pub(super) record_pat_syntax: Option<ast::RecordPat>, |
42 | pub(super) record_field_syntax: Option<ast::RecordField>, | 42 | pub(super) record_field_syntax: Option<ast::RecordExprField>, |
43 | pub(super) impl_def: Option<ast::ImplDef>, | 43 | pub(super) impl_def: Option<ast::Impl>, |
44 | /// FIXME: `ActiveParameter` is string-based, which is very very wrong | 44 | /// FIXME: `ActiveParameter` is string-based, which is very very wrong |
45 | pub(super) active_parameter: Option<ActiveParameter>, | 45 | pub(super) active_parameter: Option<ActiveParameter>, |
46 | pub(super) is_param: bool, | 46 | pub(super) is_param: bool, |
@@ -316,7 +316,7 @@ impl<'a> CompletionContext<'a> { | |||
316 | self.name_ref_syntax = | 316 | self.name_ref_syntax = |
317 | find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); | 317 | find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); |
318 | let name_range = name_ref.syntax().text_range(); | 318 | let name_range = name_ref.syntax().text_range(); |
319 | if ast::RecordField::for_field_name(&name_ref).is_some() { | 319 | if ast::RecordExprField::for_field_name(&name_ref).is_some() { |
320 | self.record_lit_syntax = | 320 | self.record_lit_syntax = |
321 | self.sema.find_node_at_offset_with_macros(&original_file, offset); | 321 | self.sema.find_node_at_offset_with_macros(&original_file, offset); |
322 | } | 322 | } |
@@ -325,7 +325,7 @@ impl<'a> CompletionContext<'a> { | |||
325 | .sema | 325 | .sema |
326 | .ancestors_with_macros(self.token.parent()) | 326 | .ancestors_with_macros(self.token.parent()) |
327 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) | 327 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) |
328 | .find_map(ast::ImplDef::cast); | 328 | .find_map(ast::Impl::cast); |
329 | 329 | ||
330 | let top_node = name_ref | 330 | let top_node = name_ref |
331 | .syntax() | 331 | .syntax() |
@@ -343,13 +343,13 @@ impl<'a> CompletionContext<'a> { | |||
343 | } | 343 | } |
344 | 344 | ||
345 | self.use_item_syntax = | 345 | self.use_item_syntax = |
346 | self.sema.ancestors_with_macros(self.token.parent()).find_map(ast::UseItem::cast); | 346 | self.sema.ancestors_with_macros(self.token.parent()).find_map(ast::Use::cast); |
347 | 347 | ||
348 | self.function_syntax = self | 348 | self.function_syntax = self |
349 | .sema | 349 | .sema |
350 | .ancestors_with_macros(self.token.parent()) | 350 | .ancestors_with_macros(self.token.parent()) |
351 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) | 351 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) |
352 | .find_map(ast::FnDef::cast); | 352 | .find_map(ast::Fn::cast); |
353 | 353 | ||
354 | self.record_field_syntax = self | 354 | self.record_field_syntax = self |
355 | .sema | 355 | .sema |
@@ -357,7 +357,7 @@ impl<'a> CompletionContext<'a> { | |||
357 | .take_while(|it| { | 357 | .take_while(|it| { |
358 | it.kind() != SOURCE_FILE && it.kind() != MODULE && it.kind() != CALL_EXPR | 358 | it.kind() != SOURCE_FILE && it.kind() != MODULE && it.kind() != CALL_EXPR |
359 | }) | 359 | }) |
360 | .find_map(ast::RecordField::cast); | 360 | .find_map(ast::RecordExprField::cast); |
361 | 361 | ||
362 | let parent = match name_ref.syntax().parent() { | 362 | let parent = match name_ref.syntax().parent() { |
363 | Some(it) => it, | 363 | Some(it) => it, |