summaryrefslogtreecommitdiff
path: root/web/assets/javascript-params.scm
blob: db300e3f0b11b75330c22374af1401004fe086ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
; JavaScript parameters, from tree-sitter/tree-sitter-javascript v0.25.0
; queries/highlights-params.scm (MIT), verbatim. Its own file because upstream
; keeps it out of the TypeScript composition: there a formal_parameters child
; is always a required_parameter or optional_parameter, so these patterns are
; not merely dead but rejected by the query compiler as impossible.

(formal_parameters [
  (identifier) @variable.parameter
  (array_pattern (identifier) @variable.parameter)
  (object_pattern [
    (pair_pattern value: (identifier) @variable.parameter)
    (shorthand_property_identifier_pattern) @variable.parameter])])