Hello Developers.
I'm already using the Clang-D Client for some Months under Windows 11 without big issues like a crash of Code::Blocks.
Now I have installed on same Windows 11 laptop under WSL2 Ubuntu and there Xavious distribution of this nightly as already discussed above.
After Installing the "codeblocks-contrib" package also I deactivated the Code-Completion and activated the Clang-D Client.
But after closing Code::Blocks and opening it again it hang and I had to exit Ubuntu and restart it again.
Fortunately I was able to reactivate my file ~/.config/codeblocks/default.conf by
replacing the xml-node <CLANGD_CLIENT bool="1" /> by <CLANGD_CLIENT bool="0" />.
Now I started some experiments together with the Windows Copilot were this is the conclusion given by the Copilot:
I've been testing the Clangd_Client plugin under Linux using Code::Blocks version 25.03+svn13739~ubuntu25.04.1 from the x-psoud PPA. While the plugin works fine under Windows, enabling it on Linux consistently causes Code::Blocks to freeze during startup.
Here s a summary of what I ve tried:
- Installed codeblocks-contrib to enable Clangd_Client and other plugins.
- Verified that clangd is installed and executable via /usr/bin/clangd.
- Disabled potentially conflicting plugins: CodeCompletion, FileManager, MouseSap, Symbols Browser, SmartIndent, OpenFilesList.
- Ensured a valid project with compile_commands.json is open before enabling Clangd_Client.
- Manually inserted a complete <clangd_client> configuration block into default.conf, including the correct LLVM path and parser settings.
- Tried launching Code::Blocks with Clangd_Client enabled and a project loaded.
- Despite all this, Code::Blocks hangs during startup. The last console output before freezing is:
- KeyBinder: adding missing menuItem[2565|&Help::Plugins::Clangd_Client...|]
This suggests the freeze occurs during menu setup, not during LSP communication. It appears to be a GUI-level issue, possibly related to wxWidgets or GTK3 event loop timing.
But when I read the line "Verified that clangd is installed and executable via /usr/bin/clangd" I became a little bit unsure and checked this again.
My finding was that this path was not the real location of clangd but only the location of a symbolic link to /usr/lib/llvm-15/bin/clangd.
So I tried out to modify the path in my manually added <clangd_client> configuration block and exchanged the lines
<LLVM_MASTERPATH>
<str>
<![CDATA[/usr/bin/clangd]]>
</str>
</LLVM_MASTERPATH>
by the lines
<LLVM_MASTERPATH>
<str>
<![CDATA[/usr/lib/llvm-15/bin/clangd]]>
</str>
</LLVM_MASTERPATH>
And suddenly Code::Blocks started normally as wanted and Clang-D is working as desired.
So the final workaround was to copy the clangs_client tree from my Windows 11 conf-file into the Linux conf-file and to set the LLVM_MASTERPATH to the real location of the binary and not to the location of a symbolic link .
<clangd_client>
<PARSER_DEFAULTS_CHANGED bool="1" />
<PARSER_FOLLOW_LOCAL_INCLUDES bool="1" />
<PARSER_FOLLOW_GLOBAL_INCLUDES bool="1" />
<WANT_PREPROCESSOR bool="1" />
<PARSE_COMPLEX_MACROS bool="1" />
<PLATFORM_CHECK bool="1" />
<SEMANTIC_KEYWORDS bool="0" />
<USE_SMARTSENSE bool="1" />
<WHILE_TYPING bool="1" />
<AUTO_ADD_PARENTHESES bool="1" />
<DETECT_IMPLEMENTATION bool="0" />
<ADD_DOXGEN_COMMENT bool="0" />
<ENABLE_HEADERS bool="1" />
<MAX_MATCHES int="1000" />
<FILLUP_CHARS>
<str>
<![CDATA[]]>
</str>
</FILLUP_CHARS>
<CC_DELAY int="300" />
<LEXER_KEYWORDS_SET1 bool="1" />
<LEXER_KEYWORDS_SET2 bool="1" />
<LEXER_KEYWORDS_SET3 bool="0" />
<LEXER_KEYWORDS_SET4 bool="0" />
<LEXER_KEYWORDS_SET5 bool="0" />
<LEXER_KEYWORDS_SET6 bool="0" />
<LEXER_KEYWORDS_SET7 bool="0" />
<LEXER_KEYWORDS_SET8 bool="0" />
<LEXER_KEYWORDS_SET9 bool="0" />
<LOGCLANGDCLIENT_CHECK bool="0" />
<LOGCLANGDSERVER_CHECK bool="0" />
<LSPMSGSFOCUSONSAVE_CHECK bool="1" />
<LSPMSGSCLEARONSAVE_CHECK bool="1" />
<LLVM_MASTERPATH>
<str>
<![CDATA[/usr/lib/llvm-15/bin/clangd]]>
</str>
</LLVM_MASTERPATH>
<MAX_THREADS int="1" />
<MAX_PARSERS_WHILE_COMPILING int="0" />
<HEADER_EXT>
<str>
<![CDATA[h,hpp,hxx,hh,h++,tcc,xpm]]>
</str>
</HEADER_EXT>
<EMPTY_EXT bool="1" />
<SOURCE_EXT>
<str>
<![CDATA[c,cpp,cxx,cc,c++]]>
</str>
</SOURCE_EXT>
<USE_SYMBOLS_BROWSER bool="1" />
<BROWSER_SHOW_INHERITANCE bool="0" />
<BROWSER_EXPAND_NS bool="1" />
<AS_FLOATING_WINDOW bool="0" />
<BROWSER_TREE_MEMBERS bool="1" />
<SCOPE_FILTER bool="1" />
<TOOLBAR_SCOPE_LENGTH int="280" />
<TOOLBAR_FUNCTION_LENGTH int="660" />
<USE_DOCUMENTATION_HELPER bool="1" />
<DOCUMENTATION_HELPER_BACKGROUND_COLOR>
<colour r="255" g="255" b="255" />
</DOCUMENTATION_HELPER_BACKGROUND_COLOR>
<DOCUMENTATION_HELPER_TEXT_COLOR>
<colour r="0" g="0" b="0" />
</DOCUMENTATION_HELPER_TEXT_COLOR>
<DOCUMENTATION_HELPER_LINK_COLOR>
<colour r="0" g="0" b="255" />
</DOCUMENTATION_HELPER_LINK_COLOR>
<BROWSER_DISPLAY_FILTER int="1" />
<BROWSER_SORT_TYPE int="1" />
<SPLITTER_POS int="219" />
<LOGPLUGININFO_CHECK bool="0" />
<LOGPLUGINDEBUG_CHECK bool="0" />
<USECOMPLETIONICONS_CHECK bool="1" />
<IGNORED_DIAGNOSTICS>
<astr>
<s>
<![CDATA[warning:Included header tree_node.hpp is not used directly (fix available) remove #include directive]]>
</s>
</astr>
</IGNORED_DIAGNOSTICS>
</clangd_client>
I hope this post is helpful for other users with asimilar problem and for you while thinking about a final solution.
Best regards,
Eckard.