HEAVILY WIP!!!
Add the following content to the tree-sitter Neovim config:
init = function()
-- Tree-sitter selinux parser
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.selinux = {
install_info = {
url = "~/src/tree-sitter-selinux",
files = { "src/parser.c" },
-- optional entries:
branch = "main",
generate_requires_npm = false,
requires_generate_from_grammar = false,
},
}
end,
See nvim-treesitter -> adding parsers for details.
The queries must be added to the nvim-treesitter runtime directory:
cd ~/.local/share/nvim/lazy/nvim-treesitter/queries
ln -s ~/src/tree-sitter-selinux/queries ./selinux
The queries must be added to the nvim-treesitter-textobjects runtime directory:
cd ~/.local/share/nvim/lazy/nvim-treesitter-textobjects/queries
ln -s ~/src/tree-sitter-selinux/queries ./selinux