diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 25cc327d05f..561b90deedd 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -196,8 +196,18 @@ Argument LANGUAGE is either `typescript' or `tsx'." (catch_clause parameter: (identifier) @font-lock-variable-name-face) + ;; full module imports (import_clause (identifier) @font-lock-variable-name-face) - (import_clause (named_imports (import_specifier (identifier)) @font-lock-variable-name-face))) + ;; named imports with aliasing + (import_clause (named_imports (import_specifier + alias: (identifier) @font-lock-variable-name-face))) + ;; named imports without aliasing + (import_clause (named_imports (import_specifier + !alias + name: (identifier) @font-lock-variable-name-face))) + + ;; full namespace import (* as alias) + (import_clause (namespace_import (identifier) @font-lock-variable-name-face))) :language language :feature 'identifier