aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorDavid Lattimore <[email protected]>2020-08-01 03:43:10 +0100
committerDavid Lattimore <[email protected]>2020-08-01 03:55:26 +0100
commit21d2cebcf1a417bce72da98aa638a20235c050db (patch)
tree5b89fe4b74fef8ce71da396d903f18e2a2ea9da2 /crates/ra_ide
parent5af32aeb2b83c7ae8adf3e088bf4f3691aa45eb1 (diff)
SSR: Matching trait associated constants, types and functions
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.
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/ssr.rs4
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.