slint_lsp + treesitter for haxe + moved to lua ftplugins
This commit is contained in:
parent
a6df31bf67
commit
5f50a2edca
8 changed files with 48 additions and 7 deletions
34
lua/plugins/treesitter.lua
Normal file
34
lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "TSUpdate",
|
||||
callback = function()
|
||||
local parsers = require 'nvim-treesitter.parsers'
|
||||
parsers.haxe = {
|
||||
install_info = {
|
||||
url = "https://github.com/vantreeseba/tree-sitter-haxe",
|
||||
branch = "main",
|
||||
queries = "queries",
|
||||
revision = "a25faf5efa842502a326ec803cfbe5a442a11e7c",
|
||||
},
|
||||
tier = 0,
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
vim.filetype.add({ extension = { hx = "haxe" } })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "haxe",
|
||||
callback = function()
|
||||
local language = vim.treesitter.language.get_lang("haxe")
|
||||
if language and vim.treesitter.language.add(language) then
|
||||
vim.treesitter.start()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue