How do you setup clangd as an lsp when using a project not built with clang?
It's giving really basic lint errors like
unknown type name 'uint8_t' because it's failing to process my precompiled headers. And completion mostly doesn't work.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
As a Clang based tool Sourcetrail supports the JSON Compilation Database format for simplified project setup. This extension enables you to generate a JSON Compilation Database from your Visual Studio projects and solutions.
Install that extension, restart visual studio, and then Sourcetrail > Create Compilation Database, then Select All, and click Create.
That cleared up a lot of my linting errors, and I sometimes get good completion results with
omnifunc=lsp#complete. Sometimes I get nothing.
I think compile_commands.json needs to be regularly regenerated since it lists compilation commands for each file. I wish there was an easy way to automate this step.
I'm using several plugins for lsp and linting support: