-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I added the parser.c file for my nvim-treesitter config as below.
treesitter.lua
return {
"nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate",
config = function()
-- Register custom parser for ballerina grammar
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.ballerina = {
install_info = {
url = "~/.config/nvim/tree-sitter-parsers/tree-sitter-ballerina",
files = { "src/parser.c" },
generate_requires_npm = false,
},
filetype = "ballerina",
}
-- treesitter configs
local config = require("nvim-treesitter.configs")
config.setup({
auto_install = true,
highlight = {
enable = true,
disable = { "latex" },
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
})
end,
}Also added .bal as a detectable file type for neovim as below.
init.lua
-- Custom filetype matchings
vim.filetype.add({
extension = {
bal = 'ballerina' -- Detect as bellerina files
},
pattern = {
[".*/hypr/.*%.conf"] = "hyprlang", -- Detect as hyprlang files
},
})When I open a .bal file nvim-treesitter even showed the "installing ballerina tressitter.." message as well.
But I don't get proper still syntax highlighting yet.
It shows like below
It is not shown in :TSModuleInfo either
I might be doing this wrong. Please correct me if it is the case.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

