aboutsummaryrefslogtreecommitdiff
path: root/helix-22.03-x86_64-windows/runtime/queries/c
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /helix-22.03-x86_64-windows/runtime/queries/c
downloadcli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.gz
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.bz2
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'helix-22.03-x86_64-windows/runtime/queries/c')
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/c/highlights.scm87
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/c/indents.toml16
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/c/injections.scm2
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/c/textobjects.scm17
4 files changed, 122 insertions, 0 deletions
diff --git a/helix-22.03-x86_64-windows/runtime/queries/c/highlights.scm b/helix-22.03-x86_64-windows/runtime/queries/c/highlights.scm
new file mode 100644
index 0000000..918f3f6
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/c/highlights.scm
@@ -0,0 +1,87 @@
+"goto" @keyword
+"register" @keyword
+"break" @keyword
+"case" @keyword
+"const" @keyword
+"continue" @keyword
+"default" @keyword
+"do" @keyword
+"else" @keyword
+"enum" @keyword
+"extern" @keyword
+"for" @keyword
+"if" @keyword
+"inline" @keyword
+"return" @keyword
+"sizeof" @keyword
+"static" @keyword
+"struct" @keyword
+"switch" @keyword
+"typedef" @keyword
+"union" @keyword
+"volatile" @keyword
+"while" @keyword
+
+[
+ "#define"
+ "#elif"
+ "#else"
+ "#endif"
+ "#if"
+ "#ifdef"
+ "#ifndef"
+ "#include"
+ (preproc_directive)
+] @keyword.directive
+
+"--" @operator
+"-" @operator
+"-=" @operator
+"->" @operator
+"=" @operator
+"!=" @operator
+"*" @operator
+"&" @operator
+"&&" @operator
+"+" @operator
+"++" @operator
+"+=" @operator
+"<" @operator
+"==" @operator
+">" @operator
+"||" @operator
+
+"." @punctuation.delimiter
+";" @punctuation.delimiter
+
+(enumerator) @type.enum.variant
+
+(string_literal) @string
+(system_lib_string) @string
+
+(null) @constant
+(number_literal) @constant.numeric.integer
+(char_literal) @constant.character
+
+(call_expression
+ function: (identifier) @function)
+(call_expression
+ function: (field_expression
+ field: (field_identifier) @function))
+(function_declarator
+ declarator: (identifier) @function)
+(preproc_function_def
+ name: (identifier) @function.special)
+
+(field_identifier) @variable.other.member
+(statement_identifier) @label
+(type_identifier) @type
+(primitive_type) @type
+(sized_type_specifier) @type
+
+((identifier) @constant
+ (#match? @constant "^[A-Z][A-Z\\d_]*$"))
+
+(identifier) @variable
+
+(comment) @comment
diff --git a/helix-22.03-x86_64-windows/runtime/queries/c/indents.toml b/helix-22.03-x86_64-windows/runtime/queries/c/indents.toml
new file mode 100644
index 0000000..f4076e1
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/c/indents.toml
@@ -0,0 +1,16 @@
+indent = [
+ "compound_statement",
+ "field_declaration_list",
+ "enumerator_list",
+ "parameter_list",
+ "init_declarator",
+ "case_statement",
+ "condition_clause",
+ "expression_statement",
+]
+
+outdent = [
+ "case",
+ "}",
+ "]",
+]
diff --git a/helix-22.03-x86_64-windows/runtime/queries/c/injections.scm b/helix-22.03-x86_64-windows/runtime/queries/c/injections.scm
new file mode 100644
index 0000000..321c90a
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/c/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/helix-22.03-x86_64-windows/runtime/queries/c/textobjects.scm b/helix-22.03-x86_64-windows/runtime/queries/c/textobjects.scm
new file mode 100644
index 0000000..45f554e
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/c/textobjects.scm
@@ -0,0 +1,17 @@
+(function_definition
+ body: (_) @function.inside) @function.around
+
+(struct_specifier
+ body: (_) @class.inside) @class.around
+
+(enum_specifier
+ body: (_) @class.inside) @class.around
+
+(union_specifier
+ body: (_) @class.inside) @class.around
+
+(parameter_declaration) @parameter.inside
+
+(comment) @comment.inside
+
+(comment)+ @comment.around