Improve fontification in typescript-ts-mode

- Restore method-name fontification.
- Fontify all types in class-declarations, extendees too

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Change patterns.
This commit is contained in:
Jostein Kjønigsen 2022-11-28 16:05:27 +01:00 committed by Yuan Fu
parent bbf1b93d43
commit 2661c51953
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -150,12 +150,20 @@
(method_definition
name: (property_identifier) @font-lock-function-name-face)
(required_parameter (identifier) @font-lock-variable-name-face)
(optional_parameter (identifier) @font-lock-variable-name-face)
(variable_declarator
name: (identifier) @font-lock-variable-name-face)
(enum_declaration (identifier) @font-lock-type-face)
(extends_clause value: (identifier) @font-lock-type-face)
;; extends React.Component<T>
(extends_clause value: (member_expression
object: (identifier) @font-lock-type-face
property: (property_identifier) @font-lock-type-face))
(arrow_function
parameter: (identifier) @font-lock-variable-name-face)
@ -267,9 +275,7 @@
:language 'tsx
:override t
:feature 'property
`(((property_identifier) @font-lock-property-face)
(pair value: (identifier) @font-lock-variable-name-face)
`((pair value: (identifier) @font-lock-variable-name-face)
((shorthand_property_identifier) @font-lock-property-face)