[BUG] clangd-lsp nagging to install but configuration doesn't support c++ modules
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I kept getting nags to install the clangd-lsp and so eventually I let it install, however it doesn't work with c++ modules.
To the extent that it errors (ie silently using the wrong flags) this was mostly hidden and I didn't notice it wasn't indexing/analyzing properly until a few times my build agent would say something weird about spurious warning that don't make sense, but nothing really bubbled up to indicate it wasn't working as intended.
The configuration file is missing .ccm as a valid c++ module file extension in its config (extensionToLanguage) at .claude/plugins/marketplaces/claude-plugins-official/.claude-plugin/marketplace.json See reference https://clang.llvm.org/docs/StandardCPlusPlusModules.html#file-name-requirements
For module projects you need to pass --experimental-modules-support to clangd. Note i do have a compile_commands.json containing the module compilations and the non-module files.
Claude suggested that these settings could be overriden in settings.json by adding something like...
"lspServers": {
"clangd": {
"command": "clangd",
"args": ["--background-index", "--experimental-modules-support"],
Maybe this just isn't supported or maybe it's not the real solution because clangd still restarted without the new flag.
Claude suggested to just modify the marketplace.json file. This does seem to let clangd start with the new settings. Though I assume its just going to get clobbered at some point.
After this it is working.
What Should Happen?
- Add the missing .ccm extension as mapping to c++
- For module projects add the missing --experimental-modules-support command line flag
- Consider that it may be running clangd in a container and the user doesn't otherwise have visibility into what diagnostics are being generated.
- Be more clear why I should install the plugin you are suggesting (what will claude be able to do that it isn't now if I install this)
- Should try to do better to identify that the project will support the lsp plugin before nagging (notice files with module naming convention?). Or it should better evaluate the project to auto configure for modules or just not offer to install in the case it isn't going to configure it. Or ask the user at install time? Or at least inform the user when it is obviously not working so they can fix or uninstall.
Error Messages/Logs
Steps to Reproduce
- Create a project using c++ modules with modules with extensions .ccm
- Install the clangd-lsp
- Notice it is either ignoring the files or trying to use invalid flags and giving spurious errors
- Not giving user proper feedback it isn't configured/working
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.34
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗