Skip to content

Is it tractable to adapt this VSCode extension to be usable without SwiftPM, e.g, to use vscode-swift with Bazel? #1326

Discussion options

You must be logged in to vote

It should be possible to make this work if you can manage to generate a compile_commands.json file. However, that can be tricky to do with Bazel's sandboxing. Something like https://github.com/kiron1/bazel-compile-commands, but for the Swift rules that you use.

The gist of it is to use bazel aquery to find the actions associated with compiling Swift (you'll have to find out which rule mnemonics do this). You can then extract the build commands for these actions. However, they will have Bazel sandbox directories in them which you'll have to deal with. You'll also have to deal with generated files as inputs if there are any.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by josh-arnold-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants