Subject: bug#61053: 29.0.60; typescript-ts-mode does not correctly highlight function-valued variables. [PATCH]

From: Theodor Thornhill <[email-masked]>
Date: Wed, 25 Jan 2023 13:06:16 +0100

Jostein Kjønigsen <[email-masked]> writes:

> When working with codebases where people define functions by assigned arrow-expressions to local variables,
> typescript-ts-mode (and tsx-ts-mode) currently does not highlight them as function declarations.
>
> // this works
> function demoFunction() {
> }
>
> // this doesnt
> const demoFunction = () => {
> };
>
> We actually have a selector for this, but it is not getting triggered, because of what looks like ordering issues.
>
> We also have override :t for almost every single feature in this mode, making it hard to know how selectors gets
> applied.
>
> Attached is a patch whic:
>
> 1. reorders selectors to correctly highlight function-declaration (required change, but not sufficient)
> 2. disables override everywhere, except for declaration, in order to keep fontification correct.
>
> So far I haven't been able to observe any ill side-effects from this change, but it might be worth double-checking.
>

Thanks, Jostein!  Looks like it works on my end aswell.

Applied and pushed, so closing this.  Keep them coming :)

Theo