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
Duplicate TextEdit in textDocument/rename response #1
Comments
It can be reproduced with the following test case:
Unfortunately issue seems to be rather related to clang api we use, https://github.com/llvm/llvm-project/blob/master/clang/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp#L84 Because visitor itself returns duplicate entries for the return type of function test() |
Another case this happens: void foo() {
if(auto add_xxx = 5) {
add_xxx = 3;
}
} try renaming |
Ycmd can cope with this as long as the old and new name have the same length, otherwise a duplicated edit does make a mess. Requesting a |
Fixed in r360116. |
Hello,
while refactoring ycmd's LSP client code, we wrote a test for clangd that sends
textDocument/rename
request on a simple file. Instead of 4 unique TextEdits, clangd returned 5 with 3rd one duplicatedThe exchanged messages, from the ycmd's side:
Clangd stderr:
The nicely formatted
textDocument/rename
request:The nicely formatted
textDocument/rename
response:The text was updated successfully, but these errors were encountered: