mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: add tree-sitter-gitattributes
This commit is contained in:
parent
1efa67e7a0
commit
721251dbfc
3 changed files with 66 additions and 0 deletions
|
|
@ -1205,6 +1205,17 @@ list.gitignore = {
|
|||
maintainers = { "@theHamsta" },
|
||||
}
|
||||
|
||||
list.gitattributes = {
|
||||
install_info = {
|
||||
url = "https://github.com/ObserverOfTime/tree-sitter-gitattributes",
|
||||
files = { "src/parser.c" },
|
||||
branch = "master",
|
||||
requires_generate_from_grammar = false,
|
||||
},
|
||||
maintainers = { "@ObserverOfTime" },
|
||||
experimental = true,
|
||||
}
|
||||
|
||||
local M = {
|
||||
list = list,
|
||||
filetype_to_parsername = filetype_to_parsername,
|
||||
|
|
|
|||
54
queries/gitattributes/highlights.scm
Normal file
54
queries/gitattributes/highlights.scm
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
(dir_sep) @punctuation.delimiter
|
||||
|
||||
(wildcard) @punctuation.special
|
||||
|
||||
(quoted_pattern
|
||||
("\"" @character.special))
|
||||
|
||||
(range_notation) @string.special
|
||||
|
||||
(range_notation
|
||||
[ "[" "]" ] @punctuation.bracket)
|
||||
|
||||
(range_negation) @operator
|
||||
|
||||
(character_class) @constant
|
||||
|
||||
(class_range ("-" @operator))
|
||||
|
||||
[
|
||||
(ansi_c_escape)
|
||||
(escaped_char)
|
||||
] @string.escape
|
||||
|
||||
(attribute
|
||||
(attr_name) @parameter)
|
||||
|
||||
(attribute
|
||||
(builtin_attr) @variable.builtin)
|
||||
|
||||
[
|
||||
(attr_reset)
|
||||
(attr_unset)
|
||||
(attr_set)
|
||||
] @operator
|
||||
|
||||
(boolean_value) @boolean
|
||||
|
||||
(string_value) @string
|
||||
|
||||
(macro_tag) @preproc
|
||||
|
||||
(macro_def
|
||||
macro_name: (_) @property)
|
||||
|
||||
[
|
||||
(pattern_negation)
|
||||
(redundant_escape)
|
||||
(trailing_slash)
|
||||
] @error
|
||||
|
||||
(ERROR) @error
|
||||
|
||||
(comment) @comment
|
||||
(comment) @spell
|
||||
1
queries/gitattributes/injections.scm
Normal file
1
queries/gitattributes/injections.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(comment) @comment
|
||||
Loading…
Add table
Add a link
Reference in a new issue