From 6bfd001b485dd27ba5fe3d22d27f021596dce4b8 Mon Sep 17 00:00:00 2001 From: voroskoi Date: Fri, 14 Jan 2022 15:29:24 +0100 Subject: Update zig tree-sitter (#1501) use latest upstream version move comptime from @keyword.function to @keyword.directive use AssignOp enhance indents--- runtime/queries/zig/highlights.scm | 5 ++--- runtime/queries/zig/indents.toml | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime/queries/zig') diff --git a/runtime/queries/zig/highlights.scm b/runtime/queries/zig/highlights.scm index 34dbeacd..62c99acc 100644 --- a/runtime/queries/zig/highlights.scm +++ b/runtime/queries/zig/highlights.scm @@ -144,7 +144,6 @@ field_constant: (IDENTIFIER) @constant ; VarDecl [ - "comptime" "threadlocal" "fn" ] @keyword.function @@ -178,6 +177,7 @@ field_constant: (IDENTIFIER) @constant ; PrecProc [ + "comptime" "inline" "noinline" "asm" @@ -195,15 +195,14 @@ field_constant: (IDENTIFIER) @constant (BitwiseOp) (BitShiftOp) (AdditionOp) + (AssignOp) (MultiplyOp) (PrefixOp) "*" "**" "->" - "=>" ".?" ".*" - "=" "?" ] @operator diff --git a/runtime/queries/zig/indents.toml b/runtime/queries/zig/indents.toml index 88f88e16..36ba8e55 100644 --- a/runtime/queries/zig/indents.toml +++ b/runtime/queries/zig/indents.toml @@ -3,6 +3,9 @@ indent = [ "BlockExpr", "ContainerDecl", "SwitchExpr", + "AssignExpr", + "ErrorUnionExpr", + "Statement", "InitList" ] -- cgit v1.2.3-70-g09d2 From fd7080498e2580d1e59580db8fd007fb081257fd Mon Sep 17 00:00:00 2001 From: Mathis Brossier Date: Thu, 20 Jan 2022 16:50:06 +0100 Subject: tree sitter comments injections (#1527) * tree sitter comments injections * trailing newlines & julia fix * Update runtime/queries/julia/injections.scm Co-authored-by: Michael Davis Co-authored-by: Michael Davis --- runtime/queries/bash/injections.scm | 2 ++ runtime/queries/c-sharp/injections.scm | 2 ++ runtime/queries/css/injections.scm | 2 ++ runtime/queries/dart/injections.scm | 2 ++ runtime/queries/go/injections.scm | 2 ++ runtime/queries/haskell/injections.scm | 2 ++ runtime/queries/html/injections.scm | 3 +++ runtime/queries/java/injections.scm | 2 ++ runtime/queries/julia/injections.scm | 6 ++---- runtime/queries/latex/injections.scm | 2 ++ runtime/queries/lua/injections.scm | 2 ++ runtime/queries/make/injections.scm | 2 ++ runtime/queries/ocaml-interface/injections.scm | 2 ++ runtime/queries/ocaml/injections.scm | 2 ++ runtime/queries/perl/injections.scm | 2 ++ runtime/queries/php/injections.scm | 3 +++ runtime/queries/protobuf/injections.scm | 2 ++ runtime/queries/ruby/injections.scm | 2 ++ runtime/queries/scala/injections.scm | 3 ++- runtime/queries/toml/injections.scm | 2 ++ runtime/queries/tsx/injections.scm | 1 + runtime/queries/typescript/injections.scm | 1 + runtime/queries/vue/injections.scm | 3 +++ runtime/queries/wgsl/injections.scm | 2 ++ runtime/queries/yaml/injections.scm | 2 +- runtime/queries/zig/injections.scm | 2 ++ 26 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 runtime/queries/bash/injections.scm create mode 100644 runtime/queries/c-sharp/injections.scm create mode 100644 runtime/queries/css/injections.scm create mode 100644 runtime/queries/dart/injections.scm create mode 100644 runtime/queries/go/injections.scm create mode 100644 runtime/queries/haskell/injections.scm create mode 100644 runtime/queries/java/injections.scm create mode 100644 runtime/queries/latex/injections.scm create mode 100644 runtime/queries/lua/injections.scm create mode 100644 runtime/queries/make/injections.scm create mode 100644 runtime/queries/ocaml-interface/injections.scm create mode 100644 runtime/queries/ocaml/injections.scm create mode 100644 runtime/queries/perl/injections.scm create mode 100644 runtime/queries/protobuf/injections.scm create mode 100644 runtime/queries/ruby/injections.scm create mode 100644 runtime/queries/toml/injections.scm create mode 100644 runtime/queries/tsx/injections.scm create mode 100644 runtime/queries/typescript/injections.scm create mode 100644 runtime/queries/wgsl/injections.scm create mode 100644 runtime/queries/zig/injections.scm (limited to 'runtime/queries/zig') diff --git a/runtime/queries/bash/injections.scm b/runtime/queries/bash/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/bash/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/c-sharp/injections.scm b/runtime/queries/c-sharp/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/c-sharp/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/css/injections.scm b/runtime/queries/css/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/css/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/dart/injections.scm b/runtime/queries/dart/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/dart/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/go/injections.scm b/runtime/queries/go/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/go/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/haskell/injections.scm b/runtime/queries/haskell/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/haskell/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/html/injections.scm b/runtime/queries/html/injections.scm index 71e7c3ae..ef58f415 100644 --- a/runtime/queries/html/injections.scm +++ b/runtime/queries/html/injections.scm @@ -1,3 +1,6 @@ +((comment) @injection.content + (#set! injection.language "comment")) + ((script_element (raw_text) @injection.content) (#set! injection.language "javascript")) diff --git a/runtime/queries/java/injections.scm b/runtime/queries/java/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/java/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/julia/injections.scm b/runtime/queries/julia/injections.scm index 3cf7339f..1c1e804e 100644 --- a/runtime/queries/julia/injections.scm +++ b/runtime/queries/julia/injections.scm @@ -1,7 +1,5 @@ -; TODO: re-add when markdown is added. -; ((triple_string) @injection.content -; (#offset! @injection.content 0 3 0 -3) -; (#set! injection.language "markdown")) +((triple_string) @injection.content + (#set! injection.language "markdown")) ((comment) @injection.content (#set! injection.language "comment")) diff --git a/runtime/queries/latex/injections.scm b/runtime/queries/latex/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/latex/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/lua/injections.scm b/runtime/queries/lua/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/lua/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/make/injections.scm b/runtime/queries/make/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/make/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/ocaml-interface/injections.scm b/runtime/queries/ocaml-interface/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/ocaml-interface/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/ocaml/injections.scm b/runtime/queries/ocaml/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/ocaml/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/perl/injections.scm b/runtime/queries/perl/injections.scm new file mode 100644 index 00000000..cab5f53d --- /dev/null +++ b/runtime/queries/perl/injections.scm @@ -0,0 +1,2 @@ +((comments) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/php/injections.scm b/runtime/queries/php/injections.scm index 16d5736b..614a3850 100644 --- a/runtime/queries/php/injections.scm +++ b/runtime/queries/php/injections.scm @@ -1,3 +1,6 @@ ((text) @injection.content (#set! injection.language "html") (#set! injection.combined)) + +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/protobuf/injections.scm b/runtime/queries/protobuf/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/protobuf/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/ruby/injections.scm b/runtime/queries/ruby/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/ruby/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/scala/injections.scm b/runtime/queries/scala/injections.scm index 4bb7d675..321c90ad 100644 --- a/runtime/queries/scala/injections.scm +++ b/runtime/queries/scala/injections.scm @@ -1 +1,2 @@ -(comment) @comment +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/toml/injections.scm b/runtime/queries/toml/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/toml/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/tsx/injections.scm b/runtime/queries/tsx/injections.scm new file mode 100644 index 00000000..1b61e36d --- /dev/null +++ b/runtime/queries/tsx/injections.scm @@ -0,0 +1 @@ +; inherits: typescript diff --git a/runtime/queries/typescript/injections.scm b/runtime/queries/typescript/injections.scm new file mode 100644 index 00000000..ff0ddfac --- /dev/null +++ b/runtime/queries/typescript/injections.scm @@ -0,0 +1 @@ +; inherits: javascript diff --git a/runtime/queries/vue/injections.scm b/runtime/queries/vue/injections.scm index 8ee34ffb..73df868b 100644 --- a/runtime/queries/vue/injections.scm +++ b/runtime/queries/vue/injections.scm @@ -15,3 +15,6 @@ ((style_element (raw_text) @injection.content) (#set! injection.language "css")) + +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/wgsl/injections.scm b/runtime/queries/wgsl/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/wgsl/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/yaml/injections.scm b/runtime/queries/yaml/injections.scm index 39bda293..321c90ad 100644 --- a/runtime/queries/yaml/injections.scm +++ b/runtime/queries/yaml/injections.scm @@ -1,2 +1,2 @@ -((comment) @injection.content +((comment) @injection.content (#set! injection.language "comment")) diff --git a/runtime/queries/zig/injections.scm b/runtime/queries/zig/injections.scm new file mode 100644 index 00000000..3df95897 --- /dev/null +++ b/runtime/queries/zig/injections.scm @@ -0,0 +1,2 @@ +([(line_comment) (doc_comment)] @injection.content + (#set! injection.language "comment")) -- cgit v1.2.3-70-g09d2