meson
meson copied to clipboard
Fix compilation database not listing every Swift source file
For SourceKit-LSP to highlight Swift sources correctly, the compile_commands.json has to contain an entry for each file with the corresponding "file" key. However, Ninja generates only one entry per build element, with the first input file as the input file for the compilation database entry, which is a problem for Swift targets consisting of multiple files since they are compiled with one command invocation per target instead of one per file. This adds entries for the build element for each input file to make LSP work for the rest of the source files to the compilation database.