Skip to content

Commit b4cba9b

Browse files
[language-typescript] Several fixes…
* Ensure private methods like `#foo` are included in lists of symbols. * Scope `void` as a unary operator. * Properly scope rest object properties in function definitions.
1 parent ef26c58 commit b4cba9b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/language-typescript/grammars/common/highlights.scm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
(shorthand_property_identifier_pattern) @variable.parameter.destructuring._LANG_)
7272
(#set! capture.final))
7373

74+
(required_parameter
75+
pattern: (object_pattern
76+
(rest_pattern (identifier) @variable.parameter.destructuring.rest._LANG_))
77+
(#set! capture.final))
78+
7479
(required_parameter
7580
pattern: (object_pattern
7681
(object_assignment_pattern
@@ -860,7 +865,7 @@
860865
(binary_expression
861866
["/" "+" "-" "*" "**" "%"] @keyword.operator.arithmetic._LANG_)
862867

863-
(unary_expression ["+" "-"] @keyword.operator.unary._LANG_)
868+
(unary_expression ["+" "-" "void"] @keyword.operator.unary._LANG_)
864869

865870
(binary_expression
866871
[

packages/language-typescript/grammars/common/tags.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
(#set! symbol.tag "function")) @definition.function
88

99
(method_definition
10-
name: (property_identifier) @name
10+
name: [(property_identifier) (private_property_identifier)] @name
1111
(#set! symbol.tag "method")) @definition.method
1212

1313
(abstract_method_signature
14-
name: (property_identifier) @name
14+
name: [(property_identifier) (private_property_identifier)] @name
1515
(#set! symbol.tag "method")) @definition.method
1616

1717
(class_declaration

0 commit comments

Comments
 (0)