[Bug] CMake Swift: Bad compile-commands.json

I am developing a swift package without SPM, instead using CMake, and would like to make use of Sourcekit-LSP in VSCode. However, I am experiencing the issue mentioned Here where my compile_commands.json is not functional. @compnerd I know you helped develop swift support for CMake, do you or anyone else know if there's a way to get this working properly? Or something other than compile_commands.json that will let Sourcekit work with non-SPM libraries?

The compile_commands.json only has the compilation commands. However, the Swift compilation model doesn't work the same way as C/C++, so we only have a link phase, which is not part of compile_commands.json. Emitting something which looks like the compile commands should be possible but I've not had time to work on that. I did have at one point the commands being generated, but never got it to be emitted into the file itself.

Terms of Service

Privacy Policy

Cookie Policy