diff options
author | David Lattimore <[email protected]> | 2020-07-29 07:01:00 +0100 |
---|---|---|
committer | David Lattimore <[email protected]> | 2020-07-29 07:01:00 +0100 |
commit | 3600c43f49f9901ffc94a139a8a3655944e91e4e (patch) | |
tree | fab3f6475ddb107c5f19834fc914704c930a1392 /crates/ra_syntax/src | |
parent | 5a8124273dd663f7f1ed43b53defc4a2c52dbc12 (diff) |
SSR: Don't mix non-path-based rules with path-based
If any rules contain paths, then we reject any rules that don't contain paths. Allowing a mix leads to strange semantics, since the path-based rules only match things where the path refers to semantically the same thing, whereas the non-path-based rules could match anything. Specifically, if we have a rule like `foo ==>> bar` we only want to match the `foo` that is in the current scope, not any `foo`. However "foo" can be parsed as a pattern (BIND_PAT -> NAME -> IDENT). Allowing such a rule through would result in renaming everything called `foo` to `bar`. It'd also be slow, since without a path, we'd have to use the slow-scan search mechanism.
Diffstat (limited to 'crates/ra_syntax/src')
0 files changed, 0 insertions, 0 deletions