From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Noah Peart Newsgroups: gmane.emacs.bugs Subject: bug#67809: [PATCH] Add font-locking for assignments in typescript-ts-mode Date: Sat, 23 Dec 2023 05:39:17 -0500 Message-ID: References: <2aa7f05f-7cfa-9a1a-4a75-88c8df53c221@gutov.dev> <83zfy1e28w.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007e0175060d2af2e1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23245"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , 67809@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 23 11:40:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rGzQV-0005rp-C2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Dec 2023 11:40:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGzQE-0001Mi-67; Sat, 23 Dec 2023 05:39:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGzQC-0001MZ-WD for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 05:39:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGzQC-0003VT-Nz for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 05:39:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGzQH-0006fY-Jl for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 05:40:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noah Peart Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Dec 2023 10:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67809 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67809-submit@debbugs.gnu.org id=B67809.170332798325606 (code B ref 67809); Sat, 23 Dec 2023 10:40:01 +0000 Original-Received: (at 67809) by debbugs.gnu.org; 23 Dec 2023 10:39:43 +0000 Original-Received: from localhost ([127.0.0.1]:48679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGzPy-0006ew-Pp for submit@debbugs.gnu.org; Sat, 23 Dec 2023 05:39:43 -0500 Original-Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:56467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGzPv-0006ei-Gg for 67809@debbugs.gnu.org; Sat, 23 Dec 2023 05:39:41 -0500 Original-Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6dbd6a9b8d0so210933a34.0 for <67809@debbugs.gnu.org>; Sat, 23 Dec 2023 02:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703327968; x=1703932768; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KVAtZrTfNDYTpANMEs7rn8YA16UKyVUWY1QWo4jN+rw=; b=ba6kpbTEPhM75F+PsfBlDQnAoCgMBax27pgcyA0mB7mGi4uALCGIwgQjKEk/xIotGF Pepl3ulRYDeBpmVXexbhvfMHaYi9Dqdj1bN8+85Rep7Sr2gCQQvcomvokyFqpMO3mxtt fSJ2na9IpK4VAIocVVSmBMtuXXfJXYTtiqe/tUWPNAOA6CmYKZXan2fJEoONUWXY6aTT hGfM45ldbtDz052iSeDIs3MWQjotlAOE89v2mAGqjH5oHfdTKscqGeLoWY3pn4Z9KYNJ hTSNSwzSz89rGqYW2ydPQAJ16x24ElEHpERT6/RdKTCu6q1vb9gma9Q72mJXYi1/+HAH ha0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703327968; x=1703932768; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KVAtZrTfNDYTpANMEs7rn8YA16UKyVUWY1QWo4jN+rw=; b=wHmmO27AQ0rnH+5OsA5B224BgHCAAFtQL0nLdHs62HbVXdMxwRSi4UAj4fBsVt0ynU f5S9zKtSoAx/r5QzdCzc9vfbCB/VMC+Mua4EmqE/1RP3eD2TIKmkHC6o14FcLXgxW/to wdNiCsKQy/fJAa8tKL9Ku9tAUMYNXIUXvNuUt/c/cFzPH8z0u6aaGVgyRSUUu8FS6qce x5AFjNAVzocWSkrpfCoquV9b/5Xg2nNPL4tFw80IfnPRqIlBBdyiY1dnWpbA8VBt02+J nrWtila6fsDBrhJlOVhqW5fYgySiGxiGcyek5kxkGkzRrPQZxvceStPyiksS60BQxNak yFEg== X-Gm-Message-State: AOJu0YyFDm3rCRFGOV8FRoH+dsv0zUc2d7x42f9zZVOdmKBfNG+zC0gL SRIyZRT5aMPTfIPiwBRj0IE8ST/xPjQPeYQ7w5w= X-Google-Smtp-Source: AGHT+IFsoTL7nDMJzCiywgk0qNdiWH023LQ9WYlhxOk1JVNiYwAZ9sArj5SUKUZejkBI39upLQ+n3QnGXDhsSHL6EQ0= X-Received: by 2002:a05:6871:810:b0:203:f156:3e94 with SMTP id q16-20020a056871081000b00203f1563e94mr3578061oap.92.1703327968394; Sat, 23 Dec 2023 02:39:28 -0800 (PST) In-Reply-To: <83zfy1e28w.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276730 Archived-At: --0000000000007e0175060d2af2e1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think this should be closed for now. On Sat, Dec 23, 2023 at 3:45=E2=80=AFAM Eli Zaretskii wrote: > > Cc: 67809@debbugs.gnu.org > > Date: Wed, 13 Dec 2023 22:45:51 +0200 > > From: Dmitry Gutov > > > > 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 i= t > > > 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 bein= g > > 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. > --0000000000007e0175060d2af2e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think this should be closed for now.

On Sat, Dec 23, 2023= at 3:45=E2=80=AFAM Eli Zaretskii <eliz@= gnu.org> wrote:
> Cc: = 67809@debbugs.gnu.org
> Date: Wed, 13 Dec 2023 22:45:51 +0200
> From: Dmitry Gutov <dmitry@gutov.dev>
>
> On 13/12/2023 21:26, Noah Peart wrote:
> > I thought `font-lock-variable-name-face` was standard for assignm= ents?=C2=A0
> > It's what is applied
> > in ruby-ts-mode, python-ts-mode, and c-ts-mode for example.=C2=A0= I like it
> > personally, cause
> > it allows for visual distinction between l/r values.
>
> ruby and python's parsers cannot distinguish between assignments t= hat
> 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.=C2=A0 It would be simpl= er 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-fac= e to it.

What is the conclusion here?=C2=A0 Do we have an agreed-upon patch to
install?

Thanks.
--0000000000007e0175060d2af2e1--