influxdata / vsflux

Flux language extension for VSCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running a flux query involves an unnecessary step and does not work the way documented

theodiefenthal opened this issue · comments

I succcessfully setup a connection to InfluxDB cloud in VSCode. According to the doc here ( https://docs.influxdata.com/influxdb/cloud/tools/flux-vscode ) , there should be a command influxdb.runQuery which doesn't appear in my vscode with an opened .flux file. the documented shortcut Ctrl+Alt+E doesn't work either, on my german keyboard it prints the Euro-€ symbol. In some doc or video I also saw that there should be a run button when opening the context menu via clicking the right mouse button within a .flux file editor window. I don't see that either.

Here is how my editor looks like:
grafik

The only way I can run a flux query is via VSCode "Run and debug"-mode, which isn't documented in the VSCode plugin doc. There is something slightly annoying about it as well. Even though I have only one connection configured, I get asked which connection to be used on each run:
grafik2

I'd be happy if you update the doc and could improve the workflow of writing a flux query where I run the same query over and over again on the same DB and don't need to specify a connection each time.

Thanks for this report. I agree that the docs could use some updating. I wasn't even aware there were docs for this, so that should indicate how out-of-date they probably are. 😬

As for the selection of instance when running flux, this is kind of an artifact of transition between vsflux as a prototype for "will this work" and vsflux as mature piece of software that provides tooling. When it was first built, the "active" instance was helpful in just bootstrapping the library. As we really started investing in the project, we started realizing that it was a departure from VSCode-specific paradigms. For instance, having a "Execute flux" in the command palette was a nice quick and dirty proof of concept, but VSCode already provides mechanisms for executing your code using F5 (and family). This also allowed us to start thinking about how we'd go about debugging flux, a feature that would be really helpful. There is an issue with dynamic debug configuration in VSCode (one we have a solution to, just haven't executed on), and we didn't want to ask the user to write a launch.json by hand, which is why we're currently prompting for the once piece of information we need in order to execute the flux. We considered just looking at the active setting again, but going back to that, only to have it go away in the near future again seemed to be a worse pattern.

Should this issue be closed since this feature won't be added?