]> git.r.bdr.sh - rbdr/tree-sitter-api-notation/blame - lua/tree-sitter-api-notation.lua
Use filetype instead of autocmd
[rbdr/tree-sitter-api-notation] / lua / tree-sitter-api-notation.lua
CommitLineData
7e8e1a0c
RBR
1
2local M = {}
3
4function M.setup()
60e517c9
RBR
5 local config_file_path = debug.getinfo(1).source:sub(2)
6 local plugin_dir = vim.fn.fnamemodify(config_file_path, ':h:h')
7e8e1a0c
RBR
7 local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
8 parser_config.api_notation = {
9 install_info = {
60e517c9 10 url = plugin_dir,
7e8e1a0c
RBR
11 files = {'src/parser.c'},
12 branch = 'main'
13 }
14 }
5b3c29fe
RBR
15 vim.filetype.add({
16 extension = {
17 api = 'api_notation',
18 apinotation = 'api_notation'
19 }
7e8e1a0c
RBR
20 })
21end
22
23return M