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#59906: 29.0.60; typescript-ts-mode is not highlighting escape sequences Date: Fri, 9 Dec 2022 12:41:59 -0800 Message-ID: <4A5322D7-45B0-4AAC-BFD3-C2DA9ABBF904@gmail.com> 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="10753"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jostein@kjonigsen.net, 59906-done@debbugs.gnu.org, Theodor Thornhill To: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 21:43:24 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 1p3kDK-0002bJ-SC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 21:43:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3kD4-0004E9-FU; Fri, 09 Dec 2022 15:43:06 -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 1p3kD1-0004Di-4A for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 15:43:05 -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 1p3kD0-0005JK-S8 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 15:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3kD0-00034Z-Nd for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 15:43:02 -0500 In-Reply-To: Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 20:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 59906 X-GNU-PR-Package: emacs Mail-Followup-To: 59906@debbugs.gnu.org, casouri@gmail.com, jostein@secure.kjonigsen.net Original-Received: via spool by 59906-done@debbugs.gnu.org id=D59906.167061853011770 (code D ref 59906); Fri, 09 Dec 2022 20:43:02 +0000 Original-Received: (at 59906-done) by debbugs.gnu.org; 9 Dec 2022 20:42:10 +0000 Original-Received: from localhost ([127.0.0.1]:38375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3kC9-00033m-Hs for submit@debbugs.gnu.org; Fri, 09 Dec 2022 15:42:09 -0500 Original-Received: from mail-pf1-f170.google.com ([209.85.210.170]:35832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3kC7-00033f-Nn for 59906-done@debbugs.gnu.org; Fri, 09 Dec 2022 15:42:08 -0500 Original-Received: by mail-pf1-f170.google.com with SMTP id g1so4531413pfk.2 for <59906-done@debbugs.gnu.org>; Fri, 09 Dec 2022 12:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=bMKWS/jGf7w+w+0WsS++VJeop6EOLoMjX6Ijepspyg4=; b=A0OqNkWh2y4PD6rxo30M4f7OXAfZyvOwjUWW0HXKDsf8ETJ6KznZmi2Mpb1E1gx4c/ e2INYCaXKEy12k3gPX6k+31z0pp4Gp0Iq+ISr0xBF/WxVHswzge4/LztWcAOjOQoSnGX kqOFbjal927p+9CVZdoZihSiB7ipI1bVo0gDv8aNsOu/wzG5pIr3Jk+PIPEa9zC85EWy t79K49MjukkIZK4lQb2LfQ9fPdUoaiGTTZlO6LNJwSjkWqq31Oq7Z5487t9Ea5kvYWNH RozeIQEBTeKvD2YX9daES+LrFHslwZBwvqHGc0mZlezHwhQifHtqFbPjK1eHzqI/J2K2 ppYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bMKWS/jGf7w+w+0WsS++VJeop6EOLoMjX6Ijepspyg4=; b=HnexSPGbAS5+Wf3uXsTU4/9bnRZhNrhTAN2fgh6yEjtlY55B1EJI5T0j+3bI5rOLwt No+76Ej1xmz+DS7bsRHecLdD8vdztlgowrYfZtbsjn7FOtPaujMgWHXOU7wqvrWPUiKX isBAYtZeFAHJ7JEnCo7PVFxF0ODCGjI5zP8VdVCf7+0O3b8kPr0JkjDLtQf35fngR3CA e7Q4vFfJe7hwdvO7AE0FSn01jAXQ3xoAKFsVEdAbSMISbhkC8SjJZRaJ8niQztgqR+i3 EcM9jbFWwjsYTnsxnrqSA38B6SCbwk9VwCRY+kQS/+4PUSI6nhXYzGfiWPXWUMJ/gQRB qF/A== X-Gm-Message-State: ANoB5pke7nJfM7W/9KseGrfYeKQLzsnw85RtVmocoHXYaXuPp5bhst0S cLzqumFvrjjYispk/xUV+Gc= X-Google-Smtp-Source: AA0mqf6QFaWxFuyWbOwUpM3TpzZlQtKxGkb0Ow5R/RZXlUh44qCZW9ieRMQPbp0TkvKLSX8Axdp2Hw== X-Received: by 2002:a62:33c4:0:b0:56c:7216:fbc6 with SMTP id z187-20020a6233c4000000b0056c7216fbc6mr6480647pfz.30.1670618521918; Fri, 09 Dec 2022 12:42:01 -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 63-20020a621442000000b005764c8f8f15sm1615240pfu.73.2022.12.09.12.42.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2022 12:42:01 -0800 (PST) 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:250455 Archived-At: Jostein Kj=C3=B8nigsen writes: > On 08.12.2022 16:19, Theodor Thornhill wrote: >> Jostein Kj=C3=B8nigsen writes: >> >>> In a buffer with typescript-ts-mode activated, write the following = code: >>> >>> const test =3D "quoted\"string\" contents"; >>> >>> The entire text, include the \" is highlighted as strings, and = escape sequences are not handled: >>> >>> This code has the following tree-sitter syntax tree: >>> >>> (lexical_declaration kind: const >>> (variable_declarator name: (identifier) value: =3D >>> (string " (string_fragment) (escape_sequence) (string_fragment) = (escape_sequence) (string_fragment) ")) >>> ;) >>> >>> In typescript-ts-mode we seemingly have rules to handle = fontification of escape sequences: >>> >>> :language language >>> :feature 'escape-sequence >>> :override t >>> '((escape_sequence) @font-lock-escape-face)) >>> >>> This feature is however not activated in the major-mode setup: >>> >>> (setq-local treesit-font-lock-feature-list >>> '((comment declaration) >>> (keyword string) >>> (constant expression identifier number pattern = property) >>> (bracket delimiter))) >>> >>> Naively I assumed that simply adding this feature would activate = this rule, but still \" is fontified as string. >> Yeah, there was an error there. See below patch. >> >> Yuan, can you install this? >> >> Theo >> > Yeah that works for me. > > Yuan: another vote for installing right here :) Yep, applied, many thanks! Yuan