aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
authorOmar Valdez <80359343+ValdezFOmar@users.noreply.github.com>2024-07-04 10:23:44 -0700
committerGitHub <noreply@github.com>2024-07-04 20:23:44 +0300
commit5d1646893a01397f2b4abea6ad546c4aa6c6efed (patch)
tree06ac242d395a6f203b2aa9afb679379c7937c27b /queries
parentbot(lockfile): update c_sharp, erlang (diff)
downloadnvim-treesitter-5d1646893a01397f2b4abea6ad546c4aa6c6efed.tar
nvim-treesitter-5d1646893a01397f2b4abea6ad546c4aa6c6efed.tar.gz
nvim-treesitter-5d1646893a01397f2b4abea6ad546c4aa6c6efed.tar.bz2
nvim-treesitter-5d1646893a01397f2b4abea6ad546c4aa6c6efed.tar.lz
nvim-treesitter-5d1646893a01397f2b4abea6ad546c4aa6c6efed.tar.xz
nvim-treesitter-5d1646893a01397f2b4abea6ad546c4aa6c6efed.tar.zst
nvim-treesitter-5d1646893a01397f2b4abea6ad546c4aa6c6efed.zip
feat: editorconfig parser and queries
Diffstat (limited to 'queries')
-rw-r--r--queries/editorconfig/folds.scm1
-rw-r--r--queries/editorconfig/highlights.scm56
-rw-r--r--queries/editorconfig/injections.scm2
3 files changed, 59 insertions, 0 deletions
diff --git a/queries/editorconfig/folds.scm b/queries/editorconfig/folds.scm
new file mode 100644
index 000000000..911798f5a
--- /dev/null
+++ b/queries/editorconfig/folds.scm
@@ -0,0 +1 @@
+(section) @fold
diff --git a/queries/editorconfig/highlights.scm b/queries/editorconfig/highlights.scm
new file mode 100644
index 000000000..fd69bc4c8
--- /dev/null
+++ b/queries/editorconfig/highlights.scm
@@ -0,0 +1,56 @@
+(comment) @comment @spell
+
+; consistency with toml and ini
+(section
+ (section_name) @type)
+
+(character_choice
+ (character) @constant)
+
+(character_range
+ start: (character) @constant
+ end: (character) @constant)
+
+[
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ ","
+ ".."
+ (path_separator)
+] @punctuation.delimiter
+
+[
+ "-"
+ "="
+ (negation)
+] @operator
+
+[
+ (wildcard_characters)
+ (wildcard_any_characters)
+ (wildcard_single_character)
+] @character.special
+
+(escaped_character) @string.escape
+
+(pair
+ key: (identifier) @property
+ value: (_) @string)
+
+(boolean) @boolean
+
+(integer) @number
+
+(unset) @constant.builtin
+
+[
+ (spelling_language)
+ (indent_style)
+ (end_of_line)
+ (charset)
+] @string.special
diff --git a/queries/editorconfig/injections.scm b/queries/editorconfig/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/queries/editorconfig/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))