The [Fuchsia extension for VS Code](https://marketplace.visualstudio.com/items?itemName=fuchsia-authors.vscode-fuchsia) 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](https://code.visualstudio.com/).

For more information on configuring Vs Code, see
[VS Code](https://fuchsia.dev/docs/reference/tools/editors/README#vs-code).

### Installation

![This figure shows the image of the fuchsia extension logo](https://fuchsia.dev/static/fuchsia-src/reference/tools/editors/vscode/images/extensions/extension-logo.png)

- Download the [Fuchsia extension](https://marketplace.visualstudio.com/items?itemName=fuchsia-authors.vscode-fuchsia) 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

> [!NOTE]
> **Note:** For more information about the Fuchsia SDK and how to configure your environment, see [Fuchsia IDK](https://fuchsia.dev/docs/development/idk/download).

1. Open your desired workspace. For example, open the [getting-started repository](https://fuchsia.dev/docs/development/idk/download) in your VS Code workspace.
2. The extension should automatically detect the path to ffx. If the path is not detected, follow these steps:
   1. In VS Code navigate to the main menu, click **Code** , then **Preferences** , then **Settings**.
   2. Under **Extensions** navigate to **Fuchsia SDK** then **Ffx Path**.
   3. Enter the path to `ffx` directory (for example, `~/fuchsia/getting-started/tools/ffx`).
   4. 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

> [!NOTE]
> **Note:** For more information about the Fuchsia source tree and how to configure your environment, see [source tree fundamentals](https://fuchsia.dev/docs/get-started/learn).

1. Open your desired workspace. For example, open the [sample repository](https://fuchsia.dev/docs/get-started/learn) in your VS Code workspace.
2. The extension should automatically detect the path to ffx. If not detected follow the following steps:
   1. In VS Code navigate to the main menu, click **Code** , then **Preferences** , then **Settings**.
   2. Under **Extensions** navigate to **Fuchsia SDK** then **Ffx Path**.
   3. Enter the path to `ffx` directory (for example, `~/fuchsia/tools/ffx`).
   4. 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](https://fuchsia.dev/docs/reference/tools/editors/vscode/fuchsia-ext-using).
[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/reference/tools/editors/vscode/fuchsia-ext-install.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/reference/tools/editors/vscode/fuchsia-ext-install.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/tools/editors/vscode/fuchsia-ext-install.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/reference/tools/editors/vscode/fuchsia-ext-install.md "Edit the source code of this page")