In my last attempt clangd worked - mostly. Enabling clangds --experimental-modules-support worked, as did actually using a matching clang version and having clangd re-use the compilation database.
What didnt work is that once I went to integrate these modules into the existing codebase, I had a few files where different versions of clangd either went into a hot loop, crashed or both. Notably some of it also crashed clang itself. I suspect that in a pure module project it may have all worked out.
•
u/cpp-ModTeam Sep 07 '26
For C++ questions, answers, help, and programming/career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.
10
u/funnansoftware Sep 06 '26 edited Sep 06 '26
I've had success using the clangd extension in combination with having your project produce compile commands.
My .vscode/settings.json basically looks like this for my C++ projects using modules:
1
u/IyeOnline Sep 06 '26
In my last attempt clangd worked - mostly. Enabling clangds
--experimental-modules-supportworked, as did actually using a matching clang version and having clangd re-use the compilation database.What didnt work is that once I went to integrate these modules into the existing codebase, I had a few files where different versions of clangd either went into a hot loop, crashed or both. Notably some of it also crashed clang itself. I suspect that in a pure module project it may have all worked out.
1
u/tartaruga232 MSVC user, r/cpp_modules Sep 07 '26
Unfortunately, this posting has been deleted by a mod. For C++ modules related things (including questions), you may alternatively use r/cpp_modules.
1
u/pjmlp Sep 06 '26
You don't.
They were going to announce something at the end of January, and so far nothing has been communicated.
https://github.com/microsoft/vscode-cpptools/issues/6302