I followed the example on the tutorial and now my toy plugin can output some customized diagnostic messages. I add the plugin to my build by using set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fplugin=/xxxxx/lib/ToyPlugin.so")
, And this works and shows in compile_commands.json.
But it seems that even I use --compile-commands-dir
when invoke Clangd, the plugin was not loaded, the diagnostics I wrote not shown, so how can I tell clangd to load a plugin when invoke?