tree-sitter-bp/scripts/minimal_init.lua
Bruno BELANYI c73eadd348 Add NeoVim test runner
For the queries that can't be tested with `tree-sitter` itself.
2024-04-11 22:09:42 +01:00

32 lines
956 B
Lua

local project_root = "." -- FIXME: relies on current working directory
vim.opt.runtimepath:append(vim.env.NVIM_PLENARY)
vim.opt.runtimepath:append(vim.env.NVIM_TREESITTER)
vim.opt.runtimepath:append(vim.env.NVIM_TREESITTER_TEXTOBJECTS)
vim.opt.runtimepath:append(vim.env.NVIM_TREESITTER_PARSER)
vim.cmd.runtime { "plugin/plenary.vim", bang = true }
vim.cmd.runtime { "plugin/nvim-treesitter.lua", bang = true }
vim.cmd.runtime { "plugin/nvim-treesitter-textobjects.lua", bang = true }
vim.filetype.add({
extension = {
bp = "bp",
},
})
vim.o.swapfile = false
vim.bo.swapfile = false
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.bp = {
install_info = {
url = project_root,
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
},
}
require("nvim-treesitter.configs").setup({
indent = { enable = true },
highlight = { enable = true },
})