mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-17 17:38:02 +00:00
feat(c-family): inherit injections
This commit is contained in:
committed by
Christian Clason
parent
628d5e442c
commit
310f0925ec
@@ -1,5 +1 @@
|
||||
((preproc_arg) @injection.content
|
||||
(#set! injection.language "arduino"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
; inherits: cpp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
((preproc_arg) @injection.content
|
||||
(#set! injection.language "c"))
|
||||
(#set! injection.self))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
((preproc_arg) @injection.content
|
||||
(#set! injection.language "cpp"))
|
||||
|
||||
; inherits: c
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
((preproc_arg) @injection.content
|
||||
(#set! injection.language "cuda"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
; inherits: cpp
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
((preproc_arg) @injection.content
|
||||
(#set! injection.language "glsl"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
; inherits: c
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
((preproc_arg) @injection.content
|
||||
(#set! injection.language "hlsl"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
; inherits: cpp
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
(macro_definition)
|
||||
] @indent.begin
|
||||
|
||||
(trait_item
|
||||
body: (_) @indent.begin)
|
||||
|
||||
(string_literal
|
||||
(escape_sequence)) @indent.begin
|
||||
|
||||
; Typing in "(" inside macro definitions breaks the tree entirely
|
||||
; Making macro_definition becoming errors
|
||||
; Offset this by adding back one indent for start of macro rules
|
||||
@@ -85,6 +91,15 @@
|
||||
|
||||
(tuple_struct_pattern
|
||||
")" @indent.end)
|
||||
; Typing in "(" inside macro definitions breaks the tree entirely
|
||||
; Making macro_definition becoming errors
|
||||
; Offset this by adding back one indent for start of macro rules
|
||||
(ERROR
|
||||
.
|
||||
"macro_rules!"
|
||||
"(" @indent.begin
|
||||
(#set! indent.immediate)
|
||||
(#set! indent.start_at_same_line))
|
||||
|
||||
(tuple_type
|
||||
")" @indent.end)
|
||||
|
||||
Reference in New Issue
Block a user