content/enterprise_influxdb/v1/tools/flux-vscode.md
The Flux Visual Studio Code (VS Code) extension provides Flux syntax highlighting, autocompletion, and a direct InfluxDB server integration that lets you run Flux scripts natively and show results in VS Code.
{{% note %}}
To use the Flux VS Code extension with InfluxDB 1.11, ensure Flux is enabled in your InfluxDB configuration file. For more information, see Enable Flux. {{% /note %}}
The Flux VS Code extension is available in the Visual Studio Marketplace. For information about installing extensions from the Visual Studio marketplace, see the Extension Marketplace documentation.
To create an InfluxDB connection in VS Code:
influxdb.addConnection..flux extension or set the
VS Code Language Mode to Flux.influxdb.runQuery command or {{< keybind mac="⌃⌥E" other="Ctrl+Alt+E" >}}.After you've configured an InfluxDB connection, VS Code provides an overview of buckets, measurements, and tags in your InfluxDB organization. Use the InfluxDB pane in VS code to explore your schema.
{{< img-hd src="/img/influxdb/1-8-tools-vsflux-explore-schema.png" alt="Explore your InfluxDB schema in VS Code" />}}
To view errors returned from Flux script executions, click the Errors and Warnings icons in the bottom left of your VS Code window, and then select the Output tab in the debugging pane.
{{< img-hd src="/img/influxdb/2-0-tools-vsflux-errors-warnings.png" alt="VS Code errors and warnings"/>}}
VS Code auto-updates extensions by default, but you are able to disable auto-update.
If you disable auto-update, manually update your VS Code Flux extension.
After updating the extension, reload your VS Code window ({{< keybind mac="⇧⌘P" other="Ctrl+Shift+P" >}},
and then Reload Window) to initialize the updated extensions.
| Command | Description | Keyboard shortcut | Menu context |
|---|---|---|---|
influxdb.refresh | Refresh | ||
influxdb.addConnection | Add Connection | view/title | |
influxdb.runQuery | Run Query | {{< keybind mac="⌃⌥E" other="Ctrl+Alt+E" >}} | editor/context |
influxdb.removeConnection | Remove Connection | view/item/context | |
influxdb.switchConnection | Switch Connection | ||
influxdb.editConnection | Edit Connection | view/item/context |