Crates.io | tree-sitter-perm |
lib.rs | tree-sitter-perm |
version | 0.0.4 |
source | src |
created_at | 2024-07-30 23:39:16.545306 |
updated_at | 2024-07-30 23:39:16.545306 |
description | Perm grammar for tree-sitter |
homepage | |
repository | https://github.com/tree-sitter/tree-sitter-perm |
max_upload_size | |
id | 1320465 |
size | 176,567 |
Syntax highlighting support for the Perm authorization language used by Permify for tree-sitter
I believe the grammar and highlights are complete. Checked against the mercury and notion examples from the permify docs. If there are some nasty perm files that you have that this isn't working for, let me know and I'll work on getting it working correctly (or open a issue/PR).
Add tests for all the rules
Add tests for highlighting
Add CONTRIBUTING doc
Add how to run and test locally
In your lua configs for treesitter, you need to register the perm
file extension with Neovim and
manually configure the parser with nvim-treesitter
. You can add the snippet below to your config:
vim.filetype.add({
extension = {
perm = "perm",
}
})
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.perm = {
install_info = {
url = 'https://github.com/theoriginalstove/tree-sitter-perm', -- local path or git repo
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
},
}
vim.treesitter.language.register('perm','perm')
Then source your config or reload Neovim and run :TSInstall perm
Syntax highlighting should then be enabled for .perm
files
Follow the manual install instructions in the Perm Zed Extension repo
[!note] TODO: Add instructions to installing parser to Helix text editor
[!note] TODO: Add instructions to installing parser to Emacs text editor