This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Renaming: Treat member functions like other functions
ClosedPublic

Authored by ckandeler on May 16 2023, 8:58 AM.

Details

Summary

... by skipping the conflict check. The same considerations apply.

Diff Detail

Event Timeline

ckandeler created this revision.May 16 2023, 8:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2023, 8:58 AM
ckandeler requested review of this revision.May 16 2023, 8:58 AM
hokein added inline comments.May 19 2023, 12:13 AM
clang-tools-extra/clangd/refactor/Rename.cpp
519

The change looks good. It would be nice to have a testcase, can you add one in the RenameTest, Renameable unit test?

nridge added a subscriber: nridge.May 20 2023, 5:37 PM
ckandeler added inline comments.May 22 2023, 2:10 AM
clang-tools-extra/clangd/refactor/Rename.cpp
519

For a function, the rename result ends up in LocalChanges (because there is no index), whereas the test assumes they are in GlobalChanges. Should I adapt the test code accordingly or is it not the right one for this case?

hokein added inline comments.May 22 2023, 2:40 AM
clang-tools-extra/clangd/refactor/Rename.cpp
519

I see, you're right, sorry for missing this bit.

I think it makes sense to change the RenameTest.Renamable to use LocalChanges (comparing ranges should be enough), as all testcases there are a single file.

ckandeler updated this revision to Diff 524203.May 22 2023, 2:51 AM

Added test cases.

ckandeler updated this revision to Diff 524206.May 22 2023, 2:53 AM

Formatting glitch.

ckandeler marked an inline comment as done.May 22 2023, 2:53 AM
hokein accepted this revision.May 22 2023, 3:11 AM

nice, thank you!

This revision is now accepted and ready to land.May 22 2023, 3:11 AM
ckandeler updated this revision to Diff 524214.May 22 2023, 3:25 AM

Fixed clang-format complaints.