Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mleonidas/tree-sitter-authzed
Tree Sitter Grammer and Parser for Authzed Schema
https://github.com/mleonidas/tree-sitter-authzed
Last synced: about 1 month ago
JSON representation
Tree Sitter Grammer and Parser for Authzed Schema
- Host: GitHub
- URL: https://github.com/mleonidas/tree-sitter-authzed
- Owner: mleonidas
- Created: 2023-02-15T15:05:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-06T15:37:41.000Z (about 1 year ago)
- Last Synced: 2024-08-02T06:12:10.308Z (4 months ago)
- Language: JavaScript
- Size: 1010 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-spicedb - mleonidas/tree-sitter-authzed - Neovim tree-sitter grammar and syntax for SpiceDB schemas (Developer Tools / Third-party Tools)
README
# tree-sitter-authzed
## Usage with Neovim
DISCLAIMER: until I can package this appropriately this is how I currently have it setup
Copy queries/highlights.scm to ~/.config/nvim/queries/authzed/highlights.scm or create your own
add this to your neovim config for treesitter
```
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.authzed = {
install_info = {
url = "https://github.com/mleonidas/tree-sitter-authzed", -- local path or git repo
files = { "src/parser.c" },
generate_requires_npm = false,
requires_generate_from_grammar = false,
-- optional entries:
branch = "main", -- default branch in case of git repo if different from master
},
filetype = "authzed", -- if filetype does not match the parser name
}
```
Refresh your neovim instance and run `:TsInstall authzed`
Setup an autogroup for the file extension of your choice```
augroup Authzed
au!
autocmd BufNewFile,BufRead *.authzed set ft=authzed
autocmd BufNewFile,BufRead *.zed set ft=authzed
autocmd BufNewFile,BufRead *.azd set ft=authzed
augroup END
```
Hopefully once I package this appropriately and create a vim plugin all of this will be automatic
You can also find a refrence to my neovim configuration in my dotfiles repo## Example of the highlights
![syntax](./docs/images/example-highlights.png)