[PATCH] D72071: [clangd] Add correctness checks for index-based rename

2020-01-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall requested changes to this revision. sammccall added a comment. This revision now requires changes to proceed. Postfiltering non-textual references won't work for the index-based rename, as the whole adjust-the-ranges algorithm relies on the index references being a subset of textual ma

[PATCH] D72071: [clangd] Add correctness checks for index-based rename

2020-01-02 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:378 +buildRenameEdit(FilePath, *AffectedFileCode, *RenameRanges, NewName, +RenameDecl.getNameAsString()); if (!RenameEdit) { nit: move bo

[PATCH] D72071: [clangd] Add correctness checks for index-based rename

2020-01-02 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. {icon check-circle color=green} Unit tests: pass. 61168 tests passed, 0 failed and 728 were skipped. {icon check-circle color=green} clang-tidy: pass. {icon check-circle color=green} clang-format: pass. Build artifacts

[PATCH] D72071: [clangd] Add correctness checks for index-based rename

2020-01-02 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. {icon check-circle color=green} Unit tests: pass. 61168 tests passed, 0 failed and 728 were skipped. {icon check-circle color=green} clang-tidy: pass. {icon check-circle color=green} clang-format: pass. Build artifacts

[PATCH] D72071: [clangd] Add correctness checks for index-based rename

2020-01-02 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev added a comment. @sammccall `Indexed.size() > Lexed.size()` is one of the assumptions that I think might not hold in real-world scenarios. I was reading patch heuristics code a lot and trying to understand whether anything breaks when this check is not in place, but I couldn't come up

[PATCH] D72071: [clangd] Add correctness checks for index-based rename

2020-01-02 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 235841. kbobyrev added a comment. Improve wording in the comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72071/new/ https://reviews.llvm.org/D72071 Files: clang-tools-extra/clangd/refactor/Rename.cpp

[PATCH] D72071: [clangd] Add correctness checks for index-based rename

2020-01-02 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev created this revision. kbobyrev added a reviewer: kadircet. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. In some cases the candidate ranges for rename final stage (textual replacements) are invalid and do not contain referenc