diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-26 20:30:16 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-26 20:30:16 +0000 |
commit | fc0354b2803bccfeb6e0c3335a5d4e52288c05b4 (patch) | |
tree | a1dc3edd4b21b245eeb0a54e7509373942c39a3a /crates/completion/src/context.rs | |
parent | 38d595c36fda9dc62c78c860421144999612e64c (diff) | |
parent | ee06c07f50fe590c5185807daa19de1d5540e66b (diff) |
Merge #6635
6635: Complete struct in irrefutable let r=Veykril a=Veykril
Fixes #6210
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/completion/src/context.rs')
-rw-r--r-- | crates/completion/src/context.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/completion/src/context.rs b/crates/completion/src/context.rs index bf70ee478..5cd11cf77 100644 --- a/crates/completion/src/context.rs +++ b/crates/completion/src/context.rs | |||
@@ -51,6 +51,7 @@ pub(crate) struct CompletionContext<'a> { | |||
51 | /// If a name-binding or reference to a const in a pattern. | 51 | /// If a name-binding or reference to a const in a pattern. |
52 | /// Irrefutable patterns (like let) are excluded. | 52 | /// Irrefutable patterns (like let) are excluded. |
53 | pub(super) is_pat_binding_or_const: bool, | 53 | pub(super) is_pat_binding_or_const: bool, |
54 | pub(super) is_irrefutable_let_pat_binding: bool, | ||
54 | /// A single-indent path, like `foo`. `::foo` should not be considered a trivial path. | 55 | /// A single-indent path, like `foo`. `::foo` should not be considered a trivial path. |
55 | pub(super) is_trivial_path: bool, | 56 | pub(super) is_trivial_path: bool, |
56 | /// If not a trivial path, the prefix (qualifier). | 57 | /// If not a trivial path, the prefix (qualifier). |
@@ -146,6 +147,7 @@ impl<'a> CompletionContext<'a> { | |||
146 | active_parameter: ActiveParameter::at(db, position), | 147 | active_parameter: ActiveParameter::at(db, position), |
147 | is_param: false, | 148 | is_param: false, |
148 | is_pat_binding_or_const: false, | 149 | is_pat_binding_or_const: false, |
150 | is_irrefutable_let_pat_binding: false, | ||
149 | is_trivial_path: false, | 151 | is_trivial_path: false, |
150 | path_qual: None, | 152 | path_qual: None, |
151 | after_if: false, | 153 | after_if: false, |
@@ -330,6 +332,7 @@ impl<'a> CompletionContext<'a> { | |||
330 | if pat.syntax().text_range().contains_range(bind_pat.syntax().text_range()) | 332 | if pat.syntax().text_range().contains_range(bind_pat.syntax().text_range()) |
331 | { | 333 | { |
332 | self.is_pat_binding_or_const = false; | 334 | self.is_pat_binding_or_const = false; |
335 | self.is_irrefutable_let_pat_binding = true; | ||
333 | } | 336 | } |
334 | } | 337 | } |
335 | } | 338 | } |