feat(c-family): inherit injections

This commit is contained in:
ObserverOfTime
2023-08-19 19:48:32 +03:00
committed by Christian Clason
parent 628d5e442c
commit 310f0925ec
7 changed files with 21 additions and 24 deletions

View File

@@ -1,5 +1 @@
((preproc_arg) @injection.content
(#set! injection.language "arduino"))
((comment) @injection.content
(#set! injection.language "comment"))
; inherits: cpp

View File

@@ -1,5 +1,5 @@
((preproc_arg) @injection.content
(#set! injection.language "c"))
(#set! injection.self))
((comment) @injection.content
(#set! injection.language "comment"))

View File

@@ -1,6 +1,4 @@
((preproc_arg) @injection.content
(#set! injection.language "cpp"))
; inherits: c
((comment) @injection.content
(#set! injection.language "comment"))

View File

@@ -1,5 +1 @@
((preproc_arg) @injection.content
(#set! injection.language "cuda"))
((comment) @injection.content
(#set! injection.language "comment"))
; inherits: cpp

View File

@@ -1,5 +1 @@
((preproc_arg) @injection.content
(#set! injection.language "glsl"))
((comment) @injection.content
(#set! injection.language "comment"))
; inherits: c

View File

@@ -1,5 +1 @@
((preproc_arg) @injection.content
(#set! injection.language "hlsl"))
((comment) @injection.content
(#set! injection.language "comment"))
; inherits: cpp

View File

@@ -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)