ap29600 / tree-sitter-odin

Odin grammar for tree-sitter
MIT License
17 stars 4 forks source link

keyword where is not highlighted #1

Closed doongjohn closed 2 years ago

doongjohn commented 2 years ago
say_hello :: proc(person: $T)
    where intrinsics.type_field_type(T, "name") == string {
    fmt.printf("Hello, {}!\n", person.name)
}
ap29600 commented 2 years ago

Should be fixed in the latest merge

doongjohn commented 2 years ago

thanks for the update!

however I thought I was using tree-sitter for the syntax highlight but I wasn't xD

so I disabled the regex highlighting and found out that this parser is not working

image

any idea why this is not working?

ap29600 commented 2 years ago

what does your neovim config look like? I have this snippet in there:

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.odin = {
  install_info = {
    url = "~/sources/tree-sitter-odin", -- local path or git repo
    files = {"src/parser.c"}
  },
  filetype = "odin", -- if filetype does not agree with parser name
  used_by = {} -- additional filetypes that use this parser
}

and symlink the queries folder in the github repo to <your_vim_config_location>/queries/odin

I am not 100% sure this is the correct way to do this, but it worked for me.

doongjohn commented 2 years ago

thanks a lot! now it works