[clang-tools-extra] [clangd] forward clang-tidy's readability-identifier-naming fix to textDocument/rename (PR #78454)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 01:02:45 PST 2024


https://github.com/HighCommander4 commented:

Thanks, the approach in this patch looks pretty good to me.

My only feedback is to encapsulate the "hard coding" into a function like:

```
Option<CodeActionResult::Rename> TryConvertToRename(const Diag *D, const Fix *F)
```

because I can imagine in the future coming across other diagnostics that are conceptually renames that we may want to handle this way.

Regarding testing: I find lit-tests pretty hard to read and maintain; a nicer alternative might be a gtest in `ClangdLSPServerTests` (e.g. see [this one](https://searchfox.org/llvm/rev/23b233c8adad5b81e185e50d04356fab64c2f870/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp#198) for testing call hierarchy incoming calls).

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


More information about the cfe-commits mailing list