Editor support
A range of editor integrations support Ferron configuration files (.conf / .ferron). These integrations cover syntax highlighting, formatting, completions, and diagnostics. They are useful for GitOps operators and anyone editing Ferron configuration by hand.
Feature overview#
| Feature | Description |
|---|---|
| Syntax highlighting | TextMate grammar and tree-sitter grammar for .conf / .ferron files |
| Language server (LSP) | ferron-language-server (offers formatting, directive completions, and diagnostics) |
| VS Code extension | Official extension bundling syntax highlighting and LSP |
| Zed extension | Official extension for Zed (submission under review) |
| Neovim | Manual configuration using tree-sitter and LSP |
Syntax highlighting#
Two independent grammars give syntax highlighting. Use the one compatible with your editor.
TextMate grammar#
The ferronweb/ferronconf repository hosts the TextMate grammar and distributes it as ferron.tmLanguage.json.
https://raw.githubusercontent.com/ferronweb/ferronconf/refs/heads/main/ferron.tmLanguage.jsonThis grammar works with any editor that accepts TextMate grammars, including:
- Visual Studio Code and forks (via the VS Code extension below, or manual grammar installation)
- Sublime Text
- Atom
- BBEdit
tree-sitter grammar#
The ferronweb/tree-sitter-ferron repository hosts the tree-sitter grammar and publishes it as tree-sitter-ferron on npm and crates.io.
This grammar works with editors that use tree-sitter, including:
- Neovim (via
nvim-treesitter) - Zed (via the Zed extension below, or manual grammar installation)
- Helix
- Emacs (via
tree-sitter)
Language server (LSP)#
The Ferron language server offers:
- Formatting: formats
.conffiles with the same rules asferron-fmt - Directive completions: suggests valid directives based on the loaded module set and current block context
- Diagnostics: reports parse errors, unknown directives, and invalid configurations, based on the same validation logic as
ferron validate
Installation#
npm and crates.io carry the ferron-language-server package.
npm install -g ferron-language-serverPrebuilt binaries are also available from GitHub releases and from dl.ferron.sh.
Configuration#
The language server accepts the following options:
| Option | Default | Description |
|---|---|---|
--ferron | none | Path to the directory containing the ferron binary (used for validation) and ferron-fmt binary (used for formatting) |
VS Code#
Ferron.ferron publishes the official VS Code extension as Ferron:
The extension bundles the TextMate grammar and the language server, so you do not need a separate installation.
Manual setup#
If you prefer not to use the extension, you can install the TextMate grammar manually:
-
Download the grammar file:
curl -L https://raw.githubusercontent.com/ferronweb/ferronconf/refs/heads/main/ferron.tmLanguage.json \ -o ~/.vscode/extensions/ferron.tmLanguage.json -
Install the language server separately (see Installation above) and configure it in the LSP settings of your editor.
Zed#
The ferronweb/ferron-zed repository hosts the official Zed extension. The Zed extension registry does not yet carry it (the submission is under review), but you can install it manually:
-
Clone the extension:
git clone https://github.com/ferronweb/ferron-zed.git cd ferron-zed -
Install it as a development extension (“Install Dev Extension” button in Extensions)
-
Restart Zed.
The extension bundles the tree-sitter grammar and configures the language server automatically.
Other editors#
Any editor that supports TextMate grammars or tree-sitter can use Ferron syntax highlighting. Editors that support the Language Server Protocol can use the Ferron language server for completions and diagnostics.
For editors without a dedicated extension, configure them to:
- Associate
.confor.ferronfiles with the Ferron language - Install the TextMate or tree-sitter grammar
- Point the LSP client to the
ferron-language-serverbinary
See also#
- Syntax and file structure
- Configuration formatting (
ferron-fmtfor formatting.conffiles) - Configuration validation
- Configuration doctor