From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#59660: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly Date: Mon, 28 Nov 2022 15:06:30 -0800 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33586"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59660@debbugs.gnu.org, theo@thornhill.no To: jostein@kjonigsen.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 29 00:07:36 2022 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 1oznDr-0008ZO-Rq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 00:07:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oznDe-0004YF-Tv; Mon, 28 Nov 2022 18:07:22 -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 1oznDZ-0004Wx-5d for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2022 18:07:19 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oznDK-0004Me-8B for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2022 18:07:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oznDK-0008BX-1m for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2022 18:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Nov 2022 23:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59660 X-GNU-PR-Package: emacs Original-Received: via spool by 59660-submit@debbugs.gnu.org id=B59660.166967679931454 (code B ref 59660); Mon, 28 Nov 2022 23:07:02 +0000 Original-Received: (at 59660) by debbugs.gnu.org; 28 Nov 2022 23:06:39 +0000 Original-Received: from localhost ([127.0.0.1]:51510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oznCx-0008BG-F6 for submit@debbugs.gnu.org; Mon, 28 Nov 2022 18:06:39 -0500 Original-Received: from mail-pg1-f181.google.com ([209.85.215.181]:40657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oznCv-0008BA-Mj for 59660@debbugs.gnu.org; Mon, 28 Nov 2022 18:06:38 -0500 Original-Received: by mail-pg1-f181.google.com with SMTP id f9so11316195pgf.7 for <59660@debbugs.gnu.org>; Mon, 28 Nov 2022 15:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kuRV1rlPlgnxReQZtNZ7f0PUL/V4O1zc0W5N3z6mGeE=; b=IZ+8lxJTISj7U8u31sfUQDWeDQlR63m0aoAfixzqGunw/qhtfmkqaOSAbbAO9gdAWx qwkjMPVuX9Ernz/BtuLx0gpo3QKw4Hf4UUnuIhNi5bwK3f22pcnwGjpdJVyNxJeXmuuO 1YqRsVJIZK7Akmrq+vkfnYOJReKe1mo2Kz+JAkAXKmp+7glzIQg8gB2OmvYap0ZZPZ8N hv9EtoWWQ1Tn1CiB5idVz98sssskA1T5LuZOWRNPe1sQP0LbC3IA5Ov3o9OJzZrOC4n1 7rSpnUEg4A4iQsG89T392BTDBdhOKFG2ZoAZUm4dvOs28cx+CvFNxthDP+hYKeMZbZ9w baDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kuRV1rlPlgnxReQZtNZ7f0PUL/V4O1zc0W5N3z6mGeE=; b=j4Zm61Vo/6r15J+RxrdduxBDx4N7HzTLMpXfITl2VJnT28AoGbjOZLZSh/8Oftgz3b So7bct1a6mVsA+CyGpoZZzf1DHJ8HB1TJW84MEMOXmhlruTfL2L63Hx8I6o4TRbQrRjM KzwQWtWH/6GaYqOeAj+SsGUD0yiC+aLa7yxiT1ngcxpoVJ2XdPRTenaNhpfSZSYWUFoB rt7lE4/MPJLYHs21E3z2Ilx3X6D2ojrcc+AC/DHXPs9tPwlzT+ZPyU8DR8Bn0L2eqgce JBnJL/nSWctz39Iy25wyObwq3r5QQAOM24bwvAPsNOlGtSx5n0szQMolHzckWQGvUjLw 0SoQ== X-Gm-Message-State: ANoB5pmgHVLsPIGZ1v7T/OxsXpDx+CSAcjl8JKHZCLjtMTVUKJCQXGFn HlOJZnoE0ZjTKJYpXJVQQWA= X-Google-Smtp-Source: AA0mqf4zyjT7c9rb1qgdk9Yt7ygR8Zoc7rfGYeqPIfzf7RpJiRlzXkGnqAsFKU/f3aOClsDI3nhW1A== X-Received: by 2002:a62:5b43:0:b0:573:6cfc:2210 with SMTP id p64-20020a625b43000000b005736cfc2210mr36813000pfb.55.1669676792053; Mon, 28 Nov 2022 15:06:32 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id q17-20020a170902dad100b001898ee9f723sm2235557plx.2.2022.11.28.15.06.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2022 15:06:31 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) 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:249354 Archived-At: > On Nov 28, 2022, at 7:04 AM, Jostein Kj=C3=B8nigsen = wrote: >=20 > From: "Jostein Kj=C3=B8nigsen" = > To: bug-gnu-emacs@gnu.org > Subject: 29.0.50; typescript-ts-mode consistently fontifies = method-names incorrectly > --text follows this line-- >=20 > -- > When I: >=20 > 1. create a typescript file (sample.ts) > 2. create class and add some methods to it. >=20 > I observe that: >=20 > - method names are consistently fontified as font-lock-property-face. >=20 > I expected that: >=20 > - method names to be consistently fontified as = font-luck-function-name-face. >=20 > This seems to be because of the "property_identifier" is used for > functions in the treesitter-grammar, and this property is used > indiscriminately to apply font-lock-property-face at the bottom of the > major-mode grammar. >=20 > This "shadows" the former rules which correctly apply = font-lock-function-name-face. >=20 > The best would obviously have a way to identify properties more = accurately, to precent > shadowing from taking place. Unfortunately I cannot see a realiable = way to do that > based on the current parse-tree. >=20 > Seeing as properties in Typescript are fairly rare while methods are = very common, > it seems appropriate to me to remove the property-specific = fontification rules > to restore the method-fontification rules. >=20 > I got a patch for this ready, if people are willing to accept it. Maybe you can remove the :override flag for the property_identifier = rule, so it doesn=E2=80=99t shadow the function rule? Would that work = better? Yuan=