Can't get clangd rename to work (Windows)

Clangd rename fails almost every time when trying to rename in a simple 2 file test project.

Video showing issue

I can’t see anything in the verbose log to suggest a problem. Files other than one I initiate the rename in are changed correctly, but symbols in the initial file are either not changed and are changed incorrectly (usually doubling up the final character of the name).

In the video I do two renames, in the first case there are no changes at all in the header file, and in the second attempt the appended X is added twice to the symbol in the header file.

I’m using Clangd version 11.0.0 with VSC Clangd extension version 0.1.8.

I’ve also tried using Clangd via Neovim with Coc.nvim extension and I get a similar behaviour.

Any assistance is much appreciated.

I noticed that in the log that the test.h file seems to appear twice in the rename changes:

I[18:29:44.715] <-- textDocument/rename(249)
V[18:29:44.715] ASTWorker running Rename on version 15 of d:\swdev\ClangdTest\test.h
I[18:29:44.715] --> reply:textDocument/rename(249) 0 ms
V[18:29:44.715] >>> {"id":249,"jsonrpc":"2.0","result":{"changes":{"file:///D:/swdev/ClangdTest/test.cpp":[{"newText":"Bar","range":{"end":{"character":7,"line":3},"start":{"character":4,"line":3}}},{"newText":"Bar","range":{"end":{"character":8,"line":7},"start":{"character":5,"line":7}}}],"file:///D:/swdev/ClangdTest/test.h":[{"newText":"Bar","range":{"end":{"character":8,"line":1},"start":{"character":5,"line":1}}}],"file:///d:/swdev/ClangdTest/test.h":[{"newText":"Bar","range":{"end":{"character":8,"line":1},"start":{"character":5,"line":1}}}]}}}

The file appears once as


and once as


So I guess the VSC code plugin is trying to change the file twice, leading to unwanted results.

2nd edit: I found the bug for this : Rename does not work properly in the header file · Issue #428 · clangd/clangd (