Skip to content

Commit 3272974

Browse files
authored
feat: Add gitattributes support (#259)
1 parent 1841fa3 commit 3272974

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,9 @@
418418
branch = main
419419
update = none
420420
ignore = dirty
421+
[submodule "repos/gitattributes"]
422+
path = repos/gitattributes
423+
url = https://github.com/ObserverOfTime/tree-sitter-gitattributes
424+
branch = master
425+
update = none
426+
ignore = dirty

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## Unreleased
4+
- Add `gitattributes` support
45

56
## 0.12.55 - 2023-10-05
67
- Add `SQL` support
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
(dir_sep) @punctuation.delimiter
2+
3+
(quoted_pattern
4+
("\"" @punctuation.special))
5+
6+
(range_notation) @string.special
7+
8+
(range_notation
9+
[ "[" "]" ] @punctuation.bracket)
10+
11+
(wildcard) @character.special
12+
13+
(range_negation) @operator
14+
15+
(character_class) @constant
16+
17+
(class_range ("-" @operator))
18+
19+
[
20+
(ansi_c_escape)
21+
(escaped_char)
22+
] @string.escape
23+
24+
(attribute
25+
(attr_name) @parameter)
26+
27+
(attribute
28+
(builtin_attr) @variable.builtin)
29+
30+
[
31+
(attr_reset)
32+
(attr_unset)
33+
(attr_set)
34+
] @operator
35+
36+
(boolean_value) @boolean
37+
38+
(string_value) @string
39+
40+
(macro_tag) @preproc
41+
42+
(macro_def
43+
macro_name: (_) @property)
44+
45+
[
46+
(pattern_negation)
47+
(redundant_escape)
48+
(trailing_slash)
49+
] @error
50+
51+
(ERROR) @error
52+
53+
(comment) @comment
54+
(comment) @spell

repos/gitattributes

Submodule gitattributes added at 2339ffe

tree-sitter-langs.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ See `tree-sitter-langs-repos'."
126126
(f90-mode . fortran)
127127
(fortran-mode . fortran)
128128
(gdscript-mode . gdscript)
129+
(gitattributes-mode . gitattributes)
129130
(go-mode . go)
130131
(haskell-mode . haskell)
131132
(hcl-mode . hcl)

0 commit comments

Comments
 (0)