2025-01-07, 12:36 AM
Does anyone have tips on setting up an LSP for nice editing of the C++ code?
I'm not a C++ dev, so I've just cobbled a few things together, and it's not working quite right. I have clangd, I set my editor to use `clangd-18 --background-index --clang-tidy`, and I put `set(CMAKE_EXPORT_COMPILE_COMMANDS ON)` in CMakeLists.txt. I don't get type hints, I get tons of type errors and undeclared identifiers that are obviously wrong because the code uses them fine, and "go to definition" only occasionally works, and seemingly only for third-party libraries. It seems like I'm missing something that tells the LSP about the Tangara source. I haven't had this issue with other languages before.
I'm not a C++ dev, so I've just cobbled a few things together, and it's not working quite right. I have clangd, I set my editor to use `clangd-18 --background-index --clang-tidy`, and I put `set(CMAKE_EXPORT_COMPILE_COMMANDS ON)` in CMakeLists.txt. I don't get type hints, I get tons of type errors and undeclared identifiers that are obviously wrong because the code uses them fine, and "go to definition" only occasionally works, and seemingly only for third-party libraries. It seems like I'm missing something that tells the LSP about the Tangara source. I haven't had this issue with other languages before.