Skip to content

panekj/tree-sitter-haxe

 
 

Repository files navigation

A tree sitter parser for haxe.

I've only testing this using nvim-treesitter.

Use

Install nvim-treesitter.
Clone this repo, and run tree-sitter generate (you may have to install globally).
Once generated, copy the queries to the nvim-treesitter folder

cp queries/* ~/.vim/BUNDLERPATH/nvim-treesitter/queries/haxe

For example if you're using lazy.nvim run:

cp queries/* ~/.local/share/nvim/lazy/nvim-treesitter/queries/haxe

You may have to create the haxe folder.

Add this snippet to your treesitter config or anywhere in your init.lua:

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.haxe = {
  install_info = {
    url = "https://github.com/vantreeseba/tree-sitter-haxe",
    files = {"src/parser.c"},
    -- optional entries:
    branch = "main",
  },
  filetype = "haxe",
}

Open nvim, and run TSInstallFromGrammer haxe

This should get you running.

I still don't get highlighting...

You might have to add the haxe filetype for neovim to be able to associate the grammar to your files. To do this create the appropriate file with:

touch ~/.nvim/filetype.lua

And add the following content:

vim.filetype.add({
  extension = {
    hx = 'haxe',
  },
})

What it looks like / does so far (the color scheme is of course customizeable through the highlights / etc in vim).

image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 98.9%
  • JavaScript 0.7%
  • Haxe 0.2%
  • Rust 0.1%
  • Scheme 0.1%
  • C++ 0.0%