GNU bug report logs - #67809
[PATCH] Add font-locking for assignments in typescript-ts-mode

Previous Next

Package: emacs;

Reported by: Noah Peart <noah.v.peart <at> gmail.com>

Date: Wed, 13 Dec 2023 08:34:02 UTC

Severity: wishlist

Tags: patch

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noah Peart <noah.v.peart <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 67809 <at> debbugs.gnu.org
Subject: bug#67809: [PATCH] Add font-locking for assignments in typescript-ts-mode
Date: Sat, 23 Dec 2023 05:39:17 -0500
[Message part 1 (text/plain, inline)]
I think this should be closed for now.

On Sat, Dec 23, 2023 at 3:45 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Cc: 67809 <at> debbugs.gnu.org
> > Date: Wed, 13 Dec 2023 22:45:51 +0200
> > From: Dmitry Gutov <dmitry <at> gutov.dev>
> >
> > On 13/12/2023 21:26, Noah Peart wrote:
> > > I thought `font-lock-variable-name-face` was standard for
> assignments?
> > > It's what is applied
> > > in ruby-ts-mode, python-ts-mode, and c-ts-mode for example.  I like it
> > > personally, cause
> > > it allows for visual distinction between l/r values.
> >
> > ruby and python's parsers cannot distinguish between assignments that
> > introduce a new variable (thus working as an implicit declaration) and
> > those that reassign an existing variable. Hopefully, we'll be able to
> > improve that in the future.
> >
> > TypeScript, however, has explicit variable declarations.
> >
> > > Either way, I think the patch can be simplified to only highlight the
> > > variable being assigned
> > > and not any others on the left-hand side.  It would be simpler and
> more
> > > customizable
> > > to highlight any remaining variables in a `variable` feature in a
> > > following rule.
> >
> > I'm also not sure I agree that, for example, 'arr' is the variable being
> > assigned to in the first example. Its value (the reference) doesn't
> change.
> >
> > But it's totally fine to add a 'variable' feature to
> > typescript-ts-mode's font-lock to apply font-lock-variable-use-face to
> it.
>
> What is the conclusion here?  Do we have an agreed-upon patch to
> install?
>
> Thanks.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 149 days ago.

Previous Next


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