The following VS Code extensions may provide a productive development environment for Fuchsia:
Official Fuchsia-specific extensions
Fuchsia-specific extensions provide support for working with Fuchsia software and systems. These extensions are currently supported by the Fuchsia project.
Fuchsia extension for VS Code
The Fuchsia extension for VS Code provides support for debugging Fuchsia devices, logging, and syntax highlighting. This extension is Fuchsia’s official extension and can be used with the source tree and the SDK. For more information see the Fuchsia developer extension page.
Community contributed extensions
These extensions are developed by Fuchsia contributors. Extensions listed are unsupported and could conflict with the official Fuchsia developer extension. It is recommended to use the Fuchsia developer extension.
Fuchsia.git Helper
Fuchsia.git Helper adds an "Open in...", which allows you to open a file in OSS Code Search.
To use this extension:
- Right click a file in the file editor.
- Select Open in OSS Code Search.
FuchsiAware
FuchsiAware assists with browsing Fuchsia artifacts, such as by linking from component URLs to component manifests.
Build system extensions
GN
GN adds syntax highlighting for GN files.
GNFormat
GNFormat provides GN file formatting.
You may need to configure GNFormat with the file path to your GN binary and buildtools. Do the following:
- In VS Code, launch Quick Open by running
CMD/CTRL + P
. - Type
settings
in the search field. - Click Preferences: Open Settings (JSON).
- Add the following configuration and restart VS Code:
"gnformat.path.gn": "FILE_PATH",
"gnformat.path.buildtools": "BUILD_TOOLS_PATH"
General workflow extensions
General workflow extensions provide an overall productive workflow when working with Fuchsia.
GitLens
GitLens provides highly customizable insights of git history, which allows you to see code evolution.
Language specific extensions
FIDL language support
FIDL Language Support provides syntax support and LSP-based language features in FIDL.
JSON5
In some cases, you may work on Fuchsia components using a structured configuration written in JSON5. JSON5 adds syntax highlighting for JSON5 files.
Rust-analyzer
Rust-analyzer is a Language Server Protocol (LSP) implementation for the Rust language.
To use rust-analyzer
with VS Code, Fuchsia recommends:
- Updating to the latest stable VS Code.
- Disabling telemetry reporting for confidential code.
Configure workflow
Using the fuchsia.code-workspace
configuration file
will set recommended defaults for using rust-analyzer on Fuchsia.
Beyond those defaults, here are some optional settings you may want to add to your settings.json
:
// optional: only show summary docs for functions (keeps tooltips small)
"rust-analyzer.signatureInfo.detail": "parameters",
// optional: don't activate parameterHints automatically
"editor.parameterHints.enabled": false,
Fuchsia SDK extensions
Bazel
The Fuchsia SDK uses the Bazel build system. The Bazel extension can build and run components directly from VS Code.