mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Add TS C++ queries
This commit is contained in:
26
after/queries/cpp/matchup.scm
Normal file
26
after/queries/cpp/matchup.scm
Normal file
@@ -0,0 +1,26 @@
|
||||
(preproc_ifdef
|
||||
["#ifdef" "#ifndef"] @open.def
|
||||
"#endif" @close.def) @scope.def
|
||||
|
||||
(preproc_if
|
||||
"#if" @open.def
|
||||
"#endif" @close.def) @scope.def
|
||||
|
||||
(preproc_elif "#elif" @mid.def.1)
|
||||
(preproc_else "#else" @mid.def.2)
|
||||
|
||||
(switch_statement
|
||||
"switch" @open.switch
|
||||
body: (compound_statement
|
||||
(case_statement "case" @mid.switch.1)?
|
||||
(case_statement "default" @mid.switch.2)?)) @scope.switch
|
||||
|
||||
; 'else' and 'else if'
|
||||
(if_statement
|
||||
"else" @_start (if_statement "if" @_end)?
|
||||
(#make-range! "mid.if.1" @_start @_end))
|
||||
|
||||
; if
|
||||
(compound_statement
|
||||
(if_statement
|
||||
"if" @open.if) @scope.if)
|
||||
Reference in New Issue
Block a user