bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61081: 29.0.60; typescript-ts-mode does not correctly fontify import


From: Theodor Thornhill
Subject: bug#61081: 29.0.60; typescript-ts-mode does not correctly fontify imports with aliases [PATCH]
Date: Fri, 27 Jan 2023 13:48:15 +0100

Jostein Kjønigsen <jostein@secure.kjonigsen.net> writes:

> 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
>
> Theo: Looks good to you?
>
> Yuan: I believe these same sort of fixes could be applied to js-ts-mode and 
> friends.
>

Thanks! Installing today :)

Theo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]