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

Previous Next

Package: emacs;

Reported by: jostein <at> kjonigsen.net

Date: Wed, 25 Jan 2023 09:42:01 UTC

Severity: normal

Tags: patch

Found in version 29.0.60

Fixed in version 29.1

Done: Theodor Thornhill <theo <at> thornhill.no>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 61053 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: jostein <at> kjonigsen.net
Cc: theo <at> thornhill.no, 61053 <at> debbugs.gnu.org
Subject: Re: bug#61053: 29.0.60;
 typescript-ts-mode does not correctly highlight function-valued
 variables. [PATCH]
Date: Wed, 25 Jan 2023 15:05:58 +0200
> Cc: Theodor Thornhill <theo <at> thornhill.no>
> Date: Wed, 25 Jan 2023 10:41:23 +0100
> From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
> 
> 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.

Thanks.

When fixing such "tricky" issues, please always include in the code
comments which explain the tricky stuff, in this case why some code
must be before the other.  Otherwise we run the risk that someone,
some day, will reorder the code, and we get the bug back.

Adding tests for this is even better (but doesn't make the comments
less important).




This bug report was last modified 2 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.