bors[bot] fd84c31ff7
Merge #4346
4346: Fix rename of enum variant visible from module r=matklad a=montekki

Probably fixes #4237 

It looks like the ref is found correctly in this case but it's visibility is not correctly determined. I took a stab at fixing that by adding an implementation of `HasVisibility` for `EnumVariant` so it works more or less the same way it does for struct fields.

In other words, the `search_range` here does not contain the ref since it's not considered visible:

efd8e34c39/crates/ra_ide_db/src/search.rs (L209-L214)


Before that I tried to populate `ItemScope` with visible enum variants but that ended up with breaking tests all over the place and also it looked illogical in the end: `ItemScope` is not populated with, say, public struct fields and the same should be true for `enum` variants.

I've added two more or less identical tests: one for the case with a struct field rename and one for enum variant rename; the test for struct should probably be removed and the names should be changed.


Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
2020-05-07 16:29:01 +00:00
..
2020-05-06 16:10:35 +02:00
2020-05-07 14:29:01 +02:00
2020-05-05 23:48:26 +02:00
2020-05-04 15:32:23 +02:00
2020-05-05 23:48:26 +02:00
2020-05-02 11:21:39 +02:00
2020-05-04 10:34:06 +00:00
2020-05-06 11:33:43 +02:00
2020-05-04 11:04:02 +03:00
2020-05-05 23:48:26 +02:00
2020-05-07 17:29:23 +02:00
2020-05-04 12:10:26 +02:00
2020-05-05 17:44:27 +02:00
2020-05-06 11:32:34 +02:00
2020-05-02 11:21:39 +02:00
2020-05-05 23:48:26 +02:00
2020-05-06 11:32:34 +02:00