# FIDL editors

Several editors have support for FIDL:

- [IntelliJ/Android Studio](https://fuchsia.dev/fuchsia-src/development/languages/fidl/guides/editors#intellij)
- [Sublime Text](https://fuchsia.dev/fuchsia-src/development/languages/fidl/guides/editors#sublime)
- [Vim](https://fuchsia.dev/fuchsia-src/development/languages/fidl/guides/editors#vim)
- [NeoVim](https://fuchsia.dev/fuchsia-src/development/languages/fidl/guides/editors#nvim)
- [Helix](https://fuchsia.dev/fuchsia-src/development/languages/fidl/guides/editors#helix)
- [Visual Studio Code](https://fuchsia.dev/fuchsia-src/development/languages/fidl/guides/editors#visual-studio-code)

## IntelliJ / Android Studio

There is an IntelliJ plugin available for FIDL. It adds syntax and parsing
support.To install it, select **Settings** , then **Plugins** , and then click
**Browse Repositories** and search for **FIDL**.

## Sublime Text

[Sublime syntax highlighting support](https://cs.opensource.google/fuchsia/fuchsia/+/main:/tools/fidl/editors/sublime).

To install, select **Sublime Text** , then **Preferences** , then
**Browse Packages** and copy or symlink the files `FIDL.sublime-syntax`, and
`Comments (FIDL).tmPreferences` into the **User** package.

## Vim

[Vim syntax highlighting support and instructions](https://cs.opensource.google/fuchsia/fuchsia/+/main:/tools/fidl/editors/vim).

## NeoVim

[Tree Sitter FIDL](https://github.com/google/tree-sitter-fidl).

Require NeoVim version \>= 0.9 to use
[nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) plugin.

For Googlers: You may want to build the latest NeoVim, see http://go/neovim.

1. `:TSInstall fidl` to install the parser.
2. Add filetype mapping, you may add this to /lua/options.lua: `vim.filetype.add({ extension = { fidl = "fidl" } })`.

## Helix

Helix uses [Tree Sitter FIDL](https://github.com/google/tree-sitter-fidl).

add following to `~/.config/helix/languages.toml`, or wait use a build with
[commit 358ac6bc1f512ca7303856dc904d4b4cdc1fe718](https://github.com/helix-editor/helix/commit/358ac6bc1f512ca7303856dc904d4b4cdc1fe718)

    [[language]]
    name = "fidl"
    scope = "source.fidl"
    injection-regex = "fidl"
    file-types = ["fidl"]
    comment-token = "//"
    indent = { tab-width = 4, unit = "    " }

    [[grammar]]
    name = "fidl"
    source = { git = "https://github.com/google/tree-sitter-fidl", rev = "bdbb635a7f5035e424f6173f2f11b9cd79703f8d" }

then fetch and build the parser and copy queries files to runtime dir:

    hx --grammar fetch fidl
    hx --grammar build fidl
    mkdir -p ~/.config/helix/runtime/queries/
    cp -r <path to helix source>/runtime/queries/fidl ~/.config/helix/runtime/queries

## Visual Studio Code

There is a an extension,
[Visual Studio Code extension available](https://marketplace.visualstudio.com/items?itemName=fuchsia-authors.vscode-fuchsia).

## Contributing

Contributions to other plugins are welcome. Their respective code is in:

- [IntelliJ](https://fuchsia.googlesource.com/intellij-language-fidl/)
- [Sublime](https://cs.opensource.google/fuchsia/fuchsia/+/main:/tools/fidl/editors/sublime)
- [vim](https://cs.opensource.google/fuchsia/fuchsia/+/main:/tools/fidl/editors/vim/)

[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/development/languages/fidl/guides/editors.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/development/languages/fidl/guides/editors.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/development/languages/fidl/guides/editors.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/development/languages/fidl/guides/editors.md "Edit the source code of this page")