diff options
Diffstat (limited to 'crates/ra_ssr')
-rw-r--r-- | crates/ra_ssr/src/matching.rs | 4 | ||||
-rw-r--r-- | crates/ra_ssr/src/parsing.rs | 4 | ||||
-rw-r--r-- | crates/ra_ssr/src/resolving.rs | 4 | ||||
-rw-r--r-- | crates/ra_ssr/src/tests.rs | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_ssr/src/matching.rs b/crates/ra_ssr/src/matching.rs index 74e15c631..0f72fea69 100644 --- a/crates/ra_ssr/src/matching.rs +++ b/crates/ra_ssr/src/matching.rs | |||
@@ -348,8 +348,8 @@ impl<'db, 'sema> Matcher<'db, 'sema> { | |||
348 | // separately via comparing what the path resolves to below. | 348 | // separately via comparing what the path resolves to below. |
349 | self.attempt_match_opt( | 349 | self.attempt_match_opt( |
350 | phase, | 350 | phase, |
351 | pattern_segment.type_arg_list(), | 351 | pattern_segment.generic_arg_list(), |
352 | code_segment.type_arg_list(), | 352 | code_segment.generic_arg_list(), |
353 | )?; | 353 | )?; |
354 | self.attempt_match_opt( | 354 | self.attempt_match_opt( |
355 | phase, | 355 | phase, |
diff --git a/crates/ra_ssr/src/parsing.rs b/crates/ra_ssr/src/parsing.rs index 78e03f394..f455eb5b7 100644 --- a/crates/ra_ssr/src/parsing.rs +++ b/crates/ra_ssr/src/parsing.rs | |||
@@ -70,7 +70,7 @@ impl ParsedRule { | |||
70 | rules: Vec::new(), | 70 | rules: Vec::new(), |
71 | }; | 71 | }; |
72 | builder.try_add(ast::Expr::parse(&raw_pattern), raw_template.map(ast::Expr::parse)); | 72 | builder.try_add(ast::Expr::parse(&raw_pattern), raw_template.map(ast::Expr::parse)); |
73 | builder.try_add(ast::TypeRef::parse(&raw_pattern), raw_template.map(ast::TypeRef::parse)); | 73 | builder.try_add(ast::Type::parse(&raw_pattern), raw_template.map(ast::Type::parse)); |
74 | builder.try_add(ast::Item::parse(&raw_pattern), raw_template.map(ast::Item::parse)); | 74 | builder.try_add(ast::Item::parse(&raw_pattern), raw_template.map(ast::Item::parse)); |
75 | builder.try_add(ast::Path::parse(&raw_pattern), raw_template.map(ast::Path::parse)); | 75 | builder.try_add(ast::Path::parse(&raw_pattern), raw_template.map(ast::Path::parse)); |
76 | builder.try_add(ast::Pat::parse(&raw_pattern), raw_template.map(ast::Pat::parse)); | 76 | builder.try_add(ast::Pat::parse(&raw_pattern), raw_template.map(ast::Pat::parse)); |
@@ -109,7 +109,7 @@ impl RuleBuilder { | |||
109 | // path refers to semantically the same thing, whereas the non-path-based rules could match | 109 | // path refers to semantically the same thing, whereas the non-path-based rules could match |
110 | // anything. Specifically, if we have a rule like `foo ==>> bar` we only want to match the | 110 | // anything. Specifically, if we have a rule like `foo ==>> bar` we only want to match the |
111 | // `foo` that is in the current scope, not any `foo`. However "foo" can be parsed as a | 111 | // `foo` that is in the current scope, not any `foo`. However "foo" can be parsed as a |
112 | // pattern (BIND_PAT -> NAME -> IDENT). Allowing such a rule through would result in | 112 | // pattern (IDENT_PAT -> NAME -> IDENT). Allowing such a rule through would result in |
113 | // renaming everything called `foo` to `bar`. It'd also be slow, since without a path, we'd | 113 | // renaming everything called `foo` to `bar`. It'd also be slow, since without a path, we'd |
114 | // have to use the slow-scan search mechanism. | 114 | // have to use the slow-scan search mechanism. |
115 | if self.rules.iter().any(|rule| contains_path(&rule.pattern)) { | 115 | if self.rules.iter().any(|rule| contains_path(&rule.pattern)) { |
diff --git a/crates/ra_ssr/src/resolving.rs b/crates/ra_ssr/src/resolving.rs index 78d456546..6f62000f4 100644 --- a/crates/ra_ssr/src/resolving.rs +++ b/crates/ra_ssr/src/resolving.rs | |||
@@ -198,7 +198,7 @@ fn pick_node_for_resolution(node: SyntaxNode) -> SyntaxNode { | |||
198 | return n; | 198 | return n; |
199 | } | 199 | } |
200 | } | 200 | } |
201 | SyntaxKind::LET_STMT | SyntaxKind::BIND_PAT => { | 201 | SyntaxKind::LET_STMT | SyntaxKind::IDENT_PAT => { |
202 | if let Some(next) = node.next_sibling() { | 202 | if let Some(next) = node.next_sibling() { |
203 | return pick_node_for_resolution(next); | 203 | return pick_node_for_resolution(next); |
204 | } | 204 | } |
@@ -217,7 +217,7 @@ fn pick_node_for_resolution(node: SyntaxNode) -> SyntaxNode { | |||
217 | fn path_contains_type_arguments(path: Option<ast::Path>) -> bool { | 217 | fn path_contains_type_arguments(path: Option<ast::Path>) -> bool { |
218 | if let Some(path) = path { | 218 | if let Some(path) = path { |
219 | if let Some(segment) = path.segment() { | 219 | if let Some(segment) = path.segment() { |
220 | if segment.type_arg_list().is_some() { | 220 | if segment.generic_arg_list().is_some() { |
221 | mark::hit!(type_arguments_within_path); | 221 | mark::hit!(type_arguments_within_path); |
222 | return true; | 222 | return true; |
223 | } | 223 | } |
diff --git a/crates/ra_ssr/src/tests.rs b/crates/ra_ssr/src/tests.rs index a4fa2cb44..2ae03c64c 100644 --- a/crates/ra_ssr/src/tests.rs +++ b/crates/ra_ssr/src/tests.rs | |||
@@ -924,7 +924,7 @@ fn ufcs_matches_method_call() { | |||
924 | fn pattern_is_a_single_segment_path() { | 924 | fn pattern_is_a_single_segment_path() { |
925 | mark::check!(pattern_is_a_single_segment_path); | 925 | mark::check!(pattern_is_a_single_segment_path); |
926 | // The first function should not be altered because the `foo` in scope at the cursor position is | 926 | // The first function should not be altered because the `foo` in scope at the cursor position is |
927 | // a different `foo`. This case is special because "foo" can be parsed as a pattern (BIND_PAT -> | 927 | // a different `foo`. This case is special because "foo" can be parsed as a pattern (IDENT_PAT -> |
928 | // NAME -> IDENT), which contains no path. If we're not careful we'll end up matching the `foo` | 928 | // NAME -> IDENT), which contains no path. If we're not careful we'll end up matching the `foo` |
929 | // in `let foo` from the first function. Whether we should match the `let foo` in the second | 929 | // in `let foo` from the first function. Whether we should match the `let foo` in the second |
930 | // function is less clear. At the moment, we don't. Doing so sounds like a rename operation, | 930 | // function is less clear. At the moment, we don't. Doing so sounds like a rename operation, |