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.
Prerequisites
Before you begin:
- Download Visual Studio Code.
For more information on configuring Vs Code, see VS Code.
Installation
- Download the Fuchsia extension from the Visual Studio Marketplace.
The extension automatically detects the appropriate settings for each workspace that you use, including the location of relevant tools such as ffx. If these settings are incorrect or not set automatically, follow the section below.
SDK
- Open your desired workspace. For example, open the getting-started repository in your VS Code workspace.
- The extension should automatically detect the path to ffx. If the path
is not detected, follow these steps:
- In VS Code navigate to the main menu, click Code, then Preferences, then Settings.
- Under Extensions navigate to Fuchsia SDK then Ffx Path.
- Enter the path to
ffx
directory (for example,~/fuchsia/getting-started/tools/ffx
). - Verify the extension is working via the button in the bottom right corner. Click said button, which lists a Fuchsia target device and ensure that your device is connected.
If there is no Fuchsia device that is running, including the emulator, you will see the following in the Output tab:
Running: ffxPath target,list,--format,json
exit: 2: null
Source Tree
- Open your desired workspace. For example, open the sample repository in your VS Code workspace.
- The extension should automatically detect the path to ffx. If not detected follow the following steps:
- In VS Code navigate to the main menu, click Code, then Preferences, then Settings.
- Under Extensions navigate to Fuchsia SDK then Ffx Path.
- Enter the path to
ffx
directory (for example,~/fuchsia/tools/ffx
). - Verify the extension is working via the button in the bottom right corner. Click said button, which lists a Fuchsia target device and ensure that your device is connected.
If there is no Fuchsia device that is running, including the emulator, you will see the following in the Output tab:
Running: ffxPath target,list,--format,json
exit: 2: null
You have successfully configured the Fuchsia extension! To see more information on how to use the Fuchsia extension, see Using the Fuchsia extension for VS Code.