Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename on using does not work correctly #586

Open
kirillbobyrev opened this issue Nov 11, 2020 · 1 comment
Open

Rename on using does not work correctly #586

kirillbobyrev opened this issue Nov 11, 2020 · 1 comment
Labels
bug Something isn't working rename Renaming does not work

Comments

@kirillbobyrev
Copy link
Contributor

The following example is not handled correctly: when selecting at the first location (using a::TA;), the rename is not triggered due to "there are multiple symbols under the cursor" error, when selecting the second one, using a::TA does not change, presumably because we check that all Ref targets are within TargetIDs set.

namespace some_ns {
struct A {
  void foo();
};
} // namespace some_ns
namespace a {
typedef some_ns::A [[TA]];
}

using a::[[T^A]];
auto gA = &[[T^A]]::foo;
@kirillbobyrev kirillbobyrev added the rename Renaming does not work label Nov 11, 2020
@kirillbobyrev kirillbobyrev self-assigned this Nov 11, 2020
@hokein
Copy link
Contributor

hokein commented Nov 12, 2020

looks like #170 is a similar issue.

@kirillbobyrev kirillbobyrev added the bug Something isn't working label Nov 26, 2020
tom-anders added a commit to llvm/llvm-project that referenced this issue Oct 9, 2022
Fixes clangd/clangd#170

This patch actually consists of 2 fixes:

1) Add handling for UsingShadowDecl to canonicalRenameDecl().
   This fixes the issue described in clangd/clangd#170.

2) Avoid the "there are multiple symbols under the cursor error" by applying similar
   logic as in https://reviews.llvm.org/D133664.
   This also partly fixes clangd/clangd#586.

Differential Revision: https://reviews.llvm.org/D135489
@kirillbobyrev kirillbobyrev removed their assignment Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rename Renaming does not work
Projects
None yet
Development

No branches or pull requests

2 participants