diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-07 17:29:01 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-07 17:29:01 +0100 |
commit | fd84c31ff7f48a4cde05929869dd5810a068081a (patch) | |
tree | d662138b20b83dd129182a74c925f1471aba7b72 /editors | |
parent | a9945137dc0e65ecb2ae8d0da4821afa80a367bd (diff) | |
parent | 210f0cbd27b0621c47e15c74bbb16ab47a642999 (diff) |
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:
https://github.com/rust-analyzer/rust-analyzer/blob/efd8e34c396f1524623a495e47111f1047cf2879/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 <[email protected]>
Diffstat (limited to 'editors')
0 files changed, 0 insertions, 0 deletions