[clang] [clang-tools-extra] [clangd] Add InsertReplaceEdit for code completion (PR #187623)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 28 01:41:23 PDT 2026


https://github.com/timon-ul commented:

Hi @argothiel ,
thank you for your explanation, it helped. That being said there are still some things that I am unsure about and this is why the review is still progressing a bit slow.

First off, your current changes break every client as far as I can tell (and indeed my vscode stopped giving me code completion when I use the changes). I am not really surprised by this since you change the type in the `CodeCompletion` object of  `textEdit`. I am just wondering as of now if there isn't maybe some nicer way of doing this that does not break old clients that have not yet adapted to the new functionality, but for this I do not know if we can change anything in `CodeCompletion` without it breaking.

Second thing is I am a bit hesistant on your changes on `Lexer.cpp`. I understand that you want access to `LexIdentifierContinue` since it is doing all the heavy lifting. That being said we prefer if we can confine our changes to clangd source code and do not touch clang itself. I am wondering if we cannot get around modifying this file without making things too complicated. I know we also have `clangd/support/Token.h` that provides some functions like `lex()` which might be worth looking at. Or maybe we can come up with another neat way of doing this overall. Maybe we also can come up with a way to handle unicode without sema too.

Feel free to also have a look at these things and let me know your opinion, if we work this out together I believe we can come to a conclusion a lot quicker :)

https://github.com/llvm/llvm-project/pull/187623


More information about the cfe-commits mailing list