diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 13:18:41 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 13:18:41 +0100 |
commit | 51b18ee2f1c3c9f7ea58c5f00b451e683048f618 (patch) | |
tree | 1152a079401b2d34bcc903f7935fe1aff0b7b3db /crates/ra_ide/src | |
parent | 9042009b7f1ba0f85e892ac5184fa4542d0c10f5 (diff) | |
parent | 02cac962e133d420485bc7b64698902dcc26a5e7 (diff) |
Merge #5587
5587: Finish use grammar r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide/src/folding_ranges.rs | 4 |
2 files changed, 4 insertions, 4 deletions
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> { | |||
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::FnDef>, |
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::RecordLit>, |
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::RecordField>, |
@@ -343,7 +343,7 @@ 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 |
diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 315808890..bad079146 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs | |||
@@ -58,7 +58,7 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> { | |||
58 | } | 58 | } |
59 | NodeOrToken::Node(node) => { | 59 | NodeOrToken::Node(node) => { |
60 | // Fold groups of imports | 60 | // Fold groups of imports |
61 | if node.kind() == USE_ITEM && !visited_imports.contains(&node) { | 61 | if node.kind() == USE && !visited_imports.contains(&node) { |
62 | if let Some(range) = contiguous_range_for_group(&node, &mut visited_imports) { | 62 | if let Some(range) = contiguous_range_for_group(&node, &mut visited_imports) { |
63 | res.push(Fold { range, kind: FoldKind::Imports }) | 63 | res.push(Fold { range, kind: FoldKind::Imports }) |
64 | } | 64 | } |
@@ -83,7 +83,7 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> { | |||
83 | fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> { | 83 | fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> { |
84 | match kind { | 84 | match kind { |
85 | COMMENT => Some(FoldKind::Comment), | 85 | COMMENT => Some(FoldKind::Comment), |
86 | USE_ITEM => Some(FoldKind::Imports), | 86 | USE => Some(FoldKind::Imports), |
87 | ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), | 87 | ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), |
88 | RECORD_FIELD_DEF_LIST | 88 | RECORD_FIELD_DEF_LIST |
89 | | RECORD_FIELD_PAT_LIST | 89 | | RECORD_FIELD_PAT_LIST |