]> git.r.bdr.sh - rbdr/tree-sitter-api-notation/blob - lua/tree-sitter-api-notation.lua
223958a163760bcfb3098249723704b341468d7d
[rbdr/tree-sitter-api-notation] / lua / tree-sitter-api-notation.lua
1
2 local M = {}
3
4 function M.setup()
5 local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
6 parser_config.api_notation = {
7 install_info = {
8 url = vim.fn.expand('%:p:h:h'),
9 files = {'src/parser.c'},
10 branch = 'main'
11 }
12 }
13 vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
14 pattern = {'*.api', '*.apinotation'},
15 callback = function () vim.opt.filetype = 'api_notation' end
16 })
17 end
18
19 return M