Neovim support for OpenFGA authorization models (.fga files).
- Filetype detection
- Syntax highlighting (basic vim syntax, or tree-sitter)
- LSP support (diagnostics, hover, etc.)
- Comment toggling (
gcc)
-- lazy.nvim
{
"hedengran/fga.nvim",
opts = {
-- install_treesitter_grammar = true,
-- lsp_cmd = { "node", "/path/to/vscode-ext/server/out/server.node.js", "--stdio" },
},
}Requires Neovim >= 0.9. The parser is compiled and cached automatically on first use (requires git and a C compiler).
opts = {
install_treesitter_grammar = true,
}Uses matoous/tree-sitter-fga.
Note: On Neovim < 0.9, basic syntax highlighting via
syntax/fga.luais still available without tree-sitter.
On Neovim >= 0.11, LSP works natively with no extra plugins. On older versions, nvim-lspconfig is required.
The LSP server comes from the OpenFGA VSCode extension:
git clone https://github.com/openfga/vscode-ext
cd vscode-ext
npm install && npm run compileThen point to it with lsp_cmd:
opts = {
lsp_cmd = { "node", "/path/to/vscode-ext/server/out/server.node.js", "--stdio" },
}If you have the server available as an executable on your $PATH, you can pass it directly:
opts = {
lsp_cmd = { "openfga-lsp", "--stdio" },
}MIT