mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
feat: inherit typescript schema from javascript instead
This commit is contained in:
@@ -1 +1,23 @@
|
||||
; inherits: jsx
|
||||
; functions
|
||||
(function_declaration "function" @open.function) @scope.function
|
||||
(return_statement "return" @mid.function.1)
|
||||
|
||||
; switch case
|
||||
(switch_statement "switch" @open.switch) @scope.switch
|
||||
(switch_case "case" @mid.switch.1)
|
||||
(switch_default "default" @mid.switch.2)
|
||||
|
||||
; 'else' and 'else if'
|
||||
(else_clause
|
||||
"else" @_start (if_statement "if" @_end)?
|
||||
(#make-range! "mid.if.1" @_start @_end))
|
||||
|
||||
; if
|
||||
((if_statement
|
||||
"if" @open.if) @scope.if
|
||||
(#not-has-parent? @scope.if else_clause))
|
||||
|
||||
; template strings
|
||||
(template_string
|
||||
"`" @open.tmpl_str
|
||||
"`" @close.tmpl_str) @scope.tmpl_str
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
; inherits: javascript
|
||||
|
||||
(jsx_element) @scope.tag
|
||||
(jsx_opening_element (identifier) @open.tag)
|
||||
(jsx_closing_element (identifier) @close.tag)
|
||||
@@ -7,27 +9,3 @@
|
||||
"/" @_start ">" @_end
|
||||
(#make-range! "close.selftag" @_start @_end)
|
||||
) @scope.selftag
|
||||
|
||||
; functions
|
||||
(function_declaration "function" @open.function) @scope.function
|
||||
(return_statement "return" @mid.function.1)
|
||||
|
||||
; switch case
|
||||
(switch_statement "switch" @open.switch) @scope.switch
|
||||
(switch_case "case" @mid.switch.1)
|
||||
(switch_default "default" @mid.switch.2)
|
||||
|
||||
; 'else' and 'else if'
|
||||
(else_clause
|
||||
"else" @_start (if_statement "if" @_end)?
|
||||
(#make-range! "mid.if.1" @_start @_end))
|
||||
|
||||
; if
|
||||
((if_statement
|
||||
"if" @open.if) @scope.if
|
||||
(#not-has-parent? @scope.if else_clause))
|
||||
|
||||
; template strings
|
||||
(template_string
|
||||
"`" @open.tmpl_str
|
||||
"`" @close.tmpl_str) @scope.tmpl_str
|
||||
|
||||
@@ -1,14 +1 @@
|
||||
; switch case
|
||||
(switch_statement "switch" @open.switch) @scope.switch
|
||||
(switch_case "case" @mid.switch.1)
|
||||
(switch_default "default" @mid.switch.2)
|
||||
|
||||
; 'else' and 'else if'
|
||||
(else_clause
|
||||
"else" @_start (if_statement "if" @_end)?
|
||||
(#make-range! "mid.if.1" @_start @_end))
|
||||
|
||||
; if
|
||||
((if_statement
|
||||
"if" @open.if) @scope.if
|
||||
(#not-has-parent? @scope.if else_clause))
|
||||
; inherits: javascript
|
||||
|
||||
Reference in New Issue
Block a user