> ## Documentation Index
> Fetch the complete documentation index at: https://forst-lang.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Editor workflow

> Install the Forst VS Code extension and use diagnostics, hover, and navigation on .ft files.

Use the **Forst VS Code extension** to edit `.ft` files with diagnostics, hover, completion, go-to-definition, rename, and formatting. Install the extension, open a project folder, and start editing. The extension downloads the compiler automatically on first use.

## 1. Install the extension

In **VS Code**: **Extensions** → search **Forst** → **Install** ([Marketplace](https://marketplace.visualstudio.com/items?itemName=forst.forst)).

In **Cursor**, **VSCodium**, or other Open VSX–compatible editors: install [\*\*Forst on Open VSX](https://open-vsx.org/extension/forst/forst).

## 2. Open your project

Open a workspace folder that contains `.ft` files (for example a service repo or the Forst `examples/in/` tree).

For example, open a file like `hello.ft`:

<Tabs>
  <Tab title="Forst">
    ```ft theme={"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}}
    package main

    func greet(): String {
    	return "Hello, World!"
    }

    func main() {
    	println(greet())
    }
    ```
  </Tab>

  <Tab title="Generated Go">
    ```go theme={"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}} theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}}
    // forst build
    package main

    func greet() string {
    	return "Hello, World!"
    }

    func main() {
    	println(greet())
    }
    ```
  </Tab>
</Tabs>

The extension starts the language server automatically and fetches the matching `forst` binary when needed. The status bar shows the LSP port (default **8081**) and connection state. Click it to open logs.

## What you get while editing

| Action                                     | What happens                                                                                                                                                                                 |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open or edit a `.ft` file                  | Diagnostics update as you type                                                                                                                                                               |
| Hover a symbol                             | Types, docs, Provider obligations, and Go import signatures (with godoc when available)                                                                                                      |
| **Go to definition** / **Find references** | Jump across same-package `.ft` files, cross-package Forst imports in the same module, **`import node`** bindings to resolved `.ts`/`.js` files, and **Go imports** to resolved `.go` sources |
| **Rename symbol**                          | Rename across merged package sources                                                                                                                                                         |
| **Format document**                        | Format the current file (experimental)                                                                                                                                                       |
| **Command palette → Forst**                | Focus logs or restart the language server                                                                                                                                                    |

Completion covers keywords, locals, same-package symbols, and members on Go-typed bindings where inference ran. Completion for Go package names after `pkg.` is not available yet.

**Go interop in the editor:** qualified imports (`fmt.Println`) and same-package `.go` functions show `go/types` signatures; godoc is included when loads succeed. **Go to definition** jumps into resolved `.go` sources for import paths, package qualifiers (`exec.Command`), same-package exports (`AddInts`), and receiver methods (`cmd.Run`). Cross-package Forst imports (e.g. Providers `auth` → `api`) use module-level typechecking so diagnostics match compile-time arity—not generated Go stubs in the source tree. See [Go interop](/docs/interop/go).

**Node interop in the editor:** `import node` path strings, module aliases, and qualified calls (`payment.create`) support **go to definition** into the resolved TypeScript or JavaScript module. Export names jump to the indexed symbol when the compiler has indexed the module. See [Node interop](/docs/interop/node).

## Settings

Change these in **VS Code → Settings** when the defaults do not match your setup:

| Setting                   | Default   | When to change                                               |
| ------------------------- | --------- | ------------------------------------------------------------ |
| `forst.compiler.path`     | *(empty)* | Point at a specific `forst` binary (local build, CI cache)   |
| `forst.compiler.download` | `true`    | Set `false` if you only want `PATH` or workspace `bin/forst` |
| `forst.lsp.autoStart`     | `true`    | Set `false` if you run `forst lsp` yourself                  |
| `forst.lsp.port`          | `8081`    | Use a different port when 8081 is taken                      |

## Commands

* **Forst: Focus output**: open the LSP log channel
* **Forst: Restart language server**: use after upgrading the compiler or when diagnostics look stale

## Troubleshooting

**No diagnostics on `.ft` files:** confirm the language mode is **Forst** (not Plain Text). Run **Forst: Restart language server** and check the **Forst** output channel.

**Stale errors after a compiler upgrade:** run **Forst: Restart language server**, or set **`forst.compiler.path`** to your new `bin/forst`.

**Parse errors on Providers syntax:** update to a recent compiler build. Providers shapes need current parser support.

## Related

<CardGroup cols={2}>
  <Card title="Forst on Marketplace" icon="puzzle-piece" href="https://marketplace.visualstudio.com/items?itemName=forst.forst">
    Install in VS Code.
  </Card>

  <Card title="Forst on Open VSX" icon="puzzle-piece" href="https://open-vsx.org/extension/forst/forst">
    Install in Cursor, VSCodium, and other Open VSX editors.
  </Card>

  <Card title="CLI reference" icon="terminal" href="/docs/workflow/cli">
    Run `forst` from the terminal, including `forst lsp`.
  </Card>
</CardGroup>
