Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation database not listing every Swift source file #14264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

2xsaiko
Copy link
Contributor

@2xsaiko 2xsaiko commented Feb 17, 2025

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.

This makes SourceKit-LSP work correctly with multi-source-file targets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants