Skip to content

Commit

Permalink
[language-typescript] Several fixes…
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
savetheclocktower committed Jun 13, 2024
1 parent ef26c58 commit b4cba9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion packages/language-typescript/grammars/common/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
(shorthand_property_identifier_pattern) @variable.parameter.destructuring._LANG_)
(#set! capture.final))

(required_parameter
pattern: (object_pattern
(rest_pattern (identifier) @variable.parameter.destructuring.rest._LANG_))
(#set! capture.final))

(required_parameter
pattern: (object_pattern
(object_assignment_pattern
Expand Down Expand Up @@ -860,7 +865,7 @@
(binary_expression
["/" "+" "-" "*" "**" "%"] @keyword.operator.arithmetic._LANG_)

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

(binary_expression
[
Expand Down
4 changes: 2 additions & 2 deletions packages/language-typescript/grammars/common/tags.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
(#set! symbol.tag "function")) @definition.function

(method_definition
name: (property_identifier) @name
name: [(property_identifier) (private_property_identifier)] @name
(#set! symbol.tag "method")) @definition.method

(abstract_method_signature
name: (property_identifier) @name
name: [(property_identifier) (private_property_identifier)] @name
(#set! symbol.tag "method")) @definition.method

(class_declaration
Expand Down

0 comments on commit b4cba9b

Please sign in to comment.