tree-sitter-rigz

Crates.iotree-sitter-rigz
lib.rstree-sitter-rigz
version0.3.0
sourcesrc
created_at2024-05-14 23:26:17.202995
updated_at2024-10-29 04:34:38.25294
descriptionRigz grammar for tree-sitter
homepage
repositoryhttps://gitlab.com/inapinch/rigz/tree-sitter-rigz
max_upload_size
id1240452
size589,110
(inapinch-io)

documentation

README

tree-sitter-rigz

Setup for Neovim

  1. Add the following to init.lua
vim.filetype.add({
  extension = {
    rigz = "rigz",
  },
})

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.rigz = {
  install_info = {
    url = "~/parsers/tree-sitter-rigz", -- local path or git repo
    files = {"src/parser.c"},
    generate_requires_npm = false, -- if stand-alone parser without npm dependencies
    requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
    branch = "main", -- default branch is not master
    filetype = 'rigz',
  },
}
  1. curl "https://gitlab.com/magicfoodhand/tree-sitter-rigz/-/raw/main/queries/highlights.scm?ref_type=heads" -o ~/.local/share/nvim/lazy/nvim-treesitter/queries/rigz/highlights.scm

Rust Derive Macro Highlighting

(macro_invocation
  (scoped_identifier
    name: (identifier) @name (#eq? @name derive_module!))

  (token_tree (raw_string_literal) @rigz_string)
)

(macro_invocation
  (scoped_identifier
    path: (identifier) @path (#eq? @path rigz_ast_derive)
    name: (identifier) @name (#eq? @name derive_module!))

  (token_tree (raw_string_literal) @rigz_string)
)
Commit count: 204

cargo fmt