rust-analyzer/crates
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
..
ra_arena Extract messy tree handling out of profiling code 2020-04-25 21:22:40 +02:00
ra_assists Simplify 2020-05-07 17:32:01 +02:00
ra_cfg Update versions 2020-02-18 16:12:40 +02:00
ra_db Add fixture doc comment 2020-05-06 18:09:28 +02:00
ra_flycheck add the allFeatures flag (true by default) 2020-05-05 22:46:42 +02:00
ra_fmt Introduce EffectExpr 2020-05-02 11:21:39 +02:00
ra_hir Remove HasVisibility implementation 2020-05-07 16:31:51 +03:00
ra_hir_def Remove HasVisibility implementation 2020-05-07 16:31:51 +03:00
ra_hir_expand Merge #4234 2020-05-02 10:30:49 +00:00
ra_hir_ty Fix usefulness check for never type 2020-05-06 17:59:27 +03:00
ra_ide Merge #4346 2020-05-07 16:29:01 +00:00
ra_ide_db Remove HasVisibility implementation 2020-05-07 16:31:51 +03:00
ra_mbe Rename ImplItem to AssocItem 2020-05-05 23:56:10 +08:00
ra_parser Fix parsing of blocks without { 2020-05-02 14:35:17 +02:00
ra_proc_macro proc_macro: add ability to log to stderr and view output in vscode 2020-04-23 01:57:02 +03:00
ra_proc_macro_srv Bump deps 2020-05-01 15:29:03 +03:00
ra_prof Simplify profiler impl (bubble up Option and shorten code 2020-04-26 00:55:49 +03:00
ra_project_model Merge #4166 2020-05-05 17:25:52 +00:00
ra_syntax Use more natural signature for Edit::apply 2020-05-05 23:23:29 +02:00
ra_text_edit Fix TODO 2020-05-06 13:21:49 +02:00
ra_tt Improve tt::Subtree debug print 2020-04-10 00:17:32 +08:00
rust-analyzer Merge #4332 2020-05-05 21:50:47 +00:00
stdx Move snake case method to heck 2020-05-03 21:35:21 +03:00
test_utils Allow fixture strings with unindented first line 2020-05-06 18:09:28 +02:00