bazelbuild / vscode-bazel

Bazel support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel
Apache License 2.0
231 stars 76 forks source link

Allow override of query with cquery #392

Open ayashjorden opened 2 months ago

ayashjorden commented 2 months ago

Hello, I'm working on a project where bazel is wraped with a toolchain. configuring vscode to use the wrapper was easy, so thank you for enabling that.

When I trigger a Bazel: build target, the extension makes the call to our bazel wrapper with a query sub-command. query is disavled/prohibited in our Bazel workspace.

Is there a way to override that and use cquery instead?

Thank you

vogelsgesang commented 2 months ago

Currently, no such option exists.

I am not opposed to adding such an option, but I am not sure about the tradeoffs here. Based on which tradeoffs was "query" disabled in your Bazel workspace?

For the time being, you could probably work around it by writing another wrapper script that replaces "query" by "cquery" before forwarding the call to your underlying bazel wrapper.

ayashjorden commented 2 months ago

Currently, no such option exists.

I am not opposed to adding such an option, but I am not sure about the tradeoffs here. Based on which tradeoffs was "query" disabled in your Bazel workspace?

For the time being, you could probably work around it by writing another wrapper script that replaces "query" by "cquery" before forwarding the call to your underlying bazel wrapper.

Thanks @vogelsgesang , that's what I ended up doing. I am not sure as I'm new to the team/org and still looking around.

Currently hitting issues with Error while parsing 'kind(.* rule, ...)': syntax error at 'rule , ...', but that's probably on our side of the call.

Appreciate the help!

As I'm not (yet) a Bazel expert, would it be still valid to add support for cquery as part of the plugin?

vogelsgesang commented 2 months ago

As I'm not (yet) a Bazel expert, would it be still valid to add support for cquery as part of the plugin?

I am also not a Bazel expert. Also just a user... maybe @jfirebaugh or @cameron-martin have more in-depth thoughts on the tradeoffs between query vs cquery