diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-12 14:50:34 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-12 14:50:34 +0100 |
commit | 1e8b2c498a01dc2c92d6008cdc5b611cf3a96b1e (patch) | |
tree | e1f4652227443b07f592ba156dad938e11ef2e0b /crates/ra_ide | |
parent | 5b8fdfe23100b88e4fd8e210ccf6b852f5c9bf2a (diff) | |
parent | 21d2cebcf1a417bce72da98aa638a20235c050db (diff) |
Merge #5637
5637: SSR: Matching trait associated constants, types and functions r=matklad a=davidlattimore
This fixes matching of things like `HashMap::default()` by resolving `HashMap` instead of `default` (which resolves to `Default::default`).
Same for associated constants and types that are part of a trait implementation.
However, we still don't support matching calls to trait methods.
Co-authored-by: David Lattimore <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/ssr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide/src/ssr.rs b/crates/ra_ide/src/ssr.rs index 4348b43be..8be862fd6 100644 --- a/crates/ra_ide/src/ssr.rs +++ b/crates/ra_ide/src/ssr.rs | |||
@@ -21,8 +21,8 @@ use ra_ssr::{MatchFinder, SsrError, SsrRule}; | |||
21 | // replacement occurs. For example if our replacement template is `foo::Bar` and we match some | 21 | // replacement occurs. For example if our replacement template is `foo::Bar` and we match some |
22 | // code in the `foo` module, we'll insert just `Bar`. | 22 | // code in the `foo` module, we'll insert just `Bar`. |
23 | // | 23 | // |
24 | // Method calls should generally be written in UFCS form. e.g. `foo::Bar::baz($s, $a)` will match | 24 | // Inherent method calls should generally be written in UFCS form. e.g. `foo::Bar::baz($s, $a)` will |
25 | // `$s.baz($a)`, provided the method call `baz` resolves to the method `foo::Bar::baz`. | 25 | // match `$s.baz($a)`, provided the method call `baz` resolves to the method `foo::Bar::baz`. |
26 | // | 26 | // |
27 | // The scope of the search / replace will be restricted to the current selection if any, otherwise | 27 | // The scope of the search / replace will be restricted to the current selection if any, otherwise |
28 | // it will apply to the whole workspace. | 28 | // it will apply to the whole workspace. |