content/shared/influxdb-v2/tools/flux-vscode.md
[!Important]
vsflux and Flux-LSP no longer maintained
vsfluxis no longer available in the Visual Studio Marketplace. ThevsfluxVisual Studio Code extension and theflux-lspFlux Language Server Protocol plugin are no longer maintained. Their repositories have been archived and are no longer receiving updates.
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.
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.
Once installed, open the Explorer area of your VS Code user interface. A new InfluxDB pane is available below your file explorer.
{{< img-hd src="/img/influxdb/2-1-tools-vsflux-influxdb-pane.png" alt="InfluxDB pane in VS Code" />}}
To create an InfluxDB connection in VS Code:
Hover over the InfluxDB pane and then click the {{< icon "plus" >}} icon that appears.
{{< img-hd src="/img/influxdb/2-1-tools-vsflux-add-connection.png" alt="Add an InfluxDB connection in VS Code" />}}
Provide the required connection credentials:
Click Test to test the connection.
Once tested successfully, click Save.
In the InfluxDB pane:
.flux extension or set the
VS Code Language Mode to Flux.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/2-0-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 |
|---|---|
influxdb.refresh | Refresh |
influxdb.addInstance | Add Connection |