Skip to content

Commit

Permalink
tree sitter comments injections (#1527)
Browse files Browse the repository at this point in the history
* tree sitter comments injections

* trailing newlines & julia fix

* Update runtime/queries/julia/injections.scm

Co-authored-by: Michael Davis <[email protected]>

Co-authored-by: Michael Davis <[email protected]>
  • Loading branch information
k2d222 and the-mikedavis authored Jan 20, 2022
1 parent b2c8aa1 commit fd70804
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 6 deletions.
2 changes: 2 additions & 0 deletions runtime/queries/bash/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/c-sharp/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/css/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/dart/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/go/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/haskell/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
3 changes: 3 additions & 0 deletions runtime/queries/html/injections.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
((comment) @injection.content
(#set! injection.language "comment"))

((script_element
(raw_text) @injection.content)
(#set! injection.language "javascript"))
Expand Down
2 changes: 2 additions & 0 deletions runtime/queries/java/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
6 changes: 2 additions & 4 deletions runtime/queries/julia/injections.scm
Original file line number Diff line number Diff line change
@@ -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"))
2 changes: 2 additions & 0 deletions runtime/queries/latex/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/lua/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/make/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/ocaml-interface/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/ocaml/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/perl/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comments) @injection.content
(#set! injection.language "comment"))
3 changes: 3 additions & 0 deletions runtime/queries/php/injections.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
((text) @injection.content
(#set! injection.language "html")
(#set! injection.combined))

((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/protobuf/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/ruby/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
3 changes: 2 additions & 1 deletion runtime/queries/scala/injections.scm
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
(comment) @comment
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/toml/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
1 change: 1 addition & 0 deletions runtime/queries/tsx/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
; inherits: typescript
1 change: 1 addition & 0 deletions runtime/queries/typescript/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
; inherits: javascript
3 changes: 3 additions & 0 deletions runtime/queries/vue/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
((style_element
(raw_text) @injection.content)
(#set! injection.language "css"))

((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/wgsl/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 1 addition & 1 deletion runtime/queries/yaml/injections.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
((comment) @injection.content
((comment) @injection.content
(#set! injection.language "comment"))
2 changes: 2 additions & 0 deletions runtime/queries/zig/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
([(line_comment) (doc_comment)] @injection.content
(#set! injection.language "comment"))

0 comments on commit fd70804

Please sign in to comment.