diff options
Diffstat (limited to 'crates/ra_ssr/src/parsing.rs')
-rw-r--r-- | crates/ra_ssr/src/parsing.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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)) { |