vscode-bazel icon indicating copy to clipboard operation
vscode-bazel copied to clipboard

Allow override of query with cquery

Open ayashjorden opened this issue 1 year ago • 3 comments
trafficstars

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

ayashjorden avatar May 03 '24 21:05 ayashjorden

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.

vogelsgesang avatar May 04 '24 09:05 vogelsgesang

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?

ayashjorden avatar May 06 '24 17:05 ayashjorden

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

vogelsgesang avatar May 06 '24 21:05 vogelsgesang