[clangd] Fix rename for symbol introduced by UsingDecl
authorTom Praschan <13141438+tom-anders@users.noreply.github.com>
Fri, 7 Oct 2022 23:24:13 +0000 (01:24 +0200)
committerTom Praschan <13141438+tom-anders@users.noreply.github.com>
Sun, 9 Oct 2022 12:16:12 +0000 (14:16 +0200)
commitac21938fbdfa75f1eb4ca399dac4fbf3e90d472d
tree8b3e43a1451244b8cfd50304d322d72085254fee
parent5593d363560dbf470317a1db26829ce208bf37fb
[clangd] Fix rename for symbol introduced by UsingDecl

Fixes https://github.com/clangd/clangd/issues/170

This patch actually consists of 2 fixes:

1) Add handling for UsingShadowDecl to canonicalRenameDecl().
   This fixes the issue described in https://github.com/clangd/clangd/issues/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 https://github.com/clangd/clangd/issues/586.

Differential Revision: https://reviews.llvm.org/D135489
clang-tools-extra/clangd/refactor/Rename.cpp
clang-tools-extra/clangd/unittests/RenameTests.cpp