summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorJostein Kjønigsen <jostein@kjonigsen.net>2023-01-26 19:54:27 +0100
committerTheodor Thornhill <theo@thornhill.no>2023-01-27 13:50:13 +0100
commitfd145499bbd7650d915c6e5e1ac95fd89738a6b9 (patch)
tree7eca97f9e6372cd30edb6d7236e21633bad8346a /lisp/emacs-lisp/lisp.el
parent752c526585fe3f10e064b9ddaca6ae6cdeaa0004 (diff)
downloademacs-fd145499bbd7650d915c6e5e1ac95fd89738a6b9.tar.gz
emacs-fd145499bbd7650d915c6e5e1ac95fd89738a6b9.tar.bz2
emacs-fd145499bbd7650d915c6e5e1ac95fd89738a6b9.zip
Fix fontification TypeScript of import-statements (bug#61081)
Currently typescript-ts-mode and tsx-ts-mode handles imports with aliases incorrectly. Consider the following case: import { someFunc as someAlias } from "module"; In this case the entire import ("someFunc as someAlias") will be highlighted as a variable name. "as" is also highlighted as a variable, rather than a reserved keyword. To be consistent with how we otherwise do things, we should only highlight the variable which is new and/or introduced, in this case "someAlias". Attached is a patch which fontifies import-declarations somewhat more correctly. The following cases have been tested and all fontify properly: import gnu from "fsf"; // highlights gnu import { gnu2 } from "fsf2"; // highlights gnu2 import { gnu as gnu3 } from "fsf3"; // highlights gnu3 import * as gnu4 from "fsf4"; // highlights gnu4 * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Tweak import_clause rules to adhere to the comment above.
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
0 files changed, 0 insertions, 0 deletions