From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eval Exec Newsgroups: gmane.emacs.bugs Subject: bug#75164: treesit-font-lock-fontify-region is easy to lost color on parse error. suggest to remain fontify on parse error. Date: Sun, 29 Dec 2024 00:25:24 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8566"; mail-complaints-to="usenet@ciao.gmane.io" To: 75164@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 28 17:26:27 2024 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 1tRZdz-00024S-EZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Dec 2024 17:26:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRZdh-000702-8N; Sat, 28 Dec 2024 11:26:09 -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 1tRZdb-0006zO-56 for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 11:26:03 -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 1tRZda-0006dO-KV for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 11:26:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=TOSkWF80jrC5ZMBuyf8wxB6GuD8HKlabWDjnDWtCoho=; b=Oo8wL+tqNYiwtcIkFXBkJwrxo+kEYUhkm94mehjydTPNxKoiKw39NjPMAJwkINoCFXtYX7z3cVJBVLf7iBt7I9UQPn/mVMAd4P/FhVEkvdZk4mUAd6aXVHsbxT5NTMl/RgpncMxs3E/JaTP0CGPr/cREf/B1VaWwxkCiCPwAE6uJnkZ08fcv1d2aq1L0ZaNcfvBR0d4w2r5JCxrpHcbb3iBe3GWHF4FkEP1A6hMlIoLuRd41+lenomfDQbFNsoV+8cqv5W8+Dc14aGAX4Ti3lTjKxqUZJeNfvu8POs4xSBwPSBz0ikSWk+nikSJn6V2d6VFRV3c+ad2ivL1y9/9fNw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRZdZ-0005O3-WD for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 11:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eval Exec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2024 16:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75164 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173540314820673 (code B ref -1); Sat, 28 Dec 2024 16:26:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2024 16:25:48 +0000 Original-Received: from localhost ([127.0.0.1]:52419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRZdL-0005NN-KQ for submit@debbugs.gnu.org; Sat, 28 Dec 2024 11:25:47 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRZdI-0005N6-DF for submit@debbugs.gnu.org; Sat, 28 Dec 2024 11:25:45 -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 1tRZdD-0006xx-Oq for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 11:25:39 -0500 Original-Received: from mail-oa1-x42.google.com ([2001:4860:4864:20::42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRZdC-0006bo-7e for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 11:25:39 -0500 Original-Received: by mail-oa1-x42.google.com with SMTP id 586e51a60fabf-29e2a50586dso3837519fac.0 for ; Sat, 28 Dec 2024 08:25:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735403135; x=1736007935; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=TOSkWF80jrC5ZMBuyf8wxB6GuD8HKlabWDjnDWtCoho=; b=VHV7xN+MjRknipR1HxqvsoC+R924qWiSuU2Z897BRu4pfMrUteDez23YhGK9IbMQFn 44Nc2VjHqiIrXQp8ahIvdcO7fGLnFHadBMSfLz8E0WkeSLvuEaJ6l5/d4tZ/B4TaXTjG BKm1O5HvR9Wh5r1jo2164YvFXyD2Eg4uJgF88usRUJDEI3e4j9o6RKQosM8Epe3zBsfD akh3Ktwzom329BPjtwliW6+eyXiJxq0McnnYDdS8XNRGpNCy2qTCXBGF7ySzuvaD0xV9 OkjGdQlGKaxLmYvXQIuiBFA8aWkE/flVq7fKTx+aDff3bHHwK0pdRBpOf1otKDUmEQvk Gn+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735403135; x=1736007935; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TOSkWF80jrC5ZMBuyf8wxB6GuD8HKlabWDjnDWtCoho=; b=lTvhOldS9E8g+jK4Fg0X4tWfWNqAZhPAbkQuJfCE5eYCLC1REUBgEaHpchADFMdCOv xx/Ou9r5120ZBodOmsQnk+SwPBPdCNyNZtHnZSLihv4M5ufaC5UhHcmrf9JtA83VrSeN WsokV2VqeXp9+/dVA+LIiOYz3BZ9EP5dQKF/6gOiRJH/nMFzvxp4axUdt7vu00cTADlh eFZnfs6j2PLSKjvCGRpQ/rLNPem3BObuuNq+BFqLIaENTb1EwntNxXlBU5ct5A5vfD6J IQO+NvkySesAfF3Jj0TwKBJCESqvi8xPeKrWfLxqi0gvBdKDq2Q7yZGDYsub/X4zT6Cj z7qQ== X-Gm-Message-State: AOJu0YxZvip6cd313PYJbEwz0jtlxcyXTW8mBKMajWt8GT85fwCebEZl BGYWK7NiHk/8wsm3p4wfNTcCGGoGdM/RRLi3sQEj9MGdRdMEKjoCExeNe44C+ZrGA8IdahTFBu2 u38Gl9UNODbmevaq2Wktf5gM9lhVyIe6aEL/RAoGkL38= X-Gm-Gg: ASbGnctMdWXgWqiBr6F4hUg8TuRWaNTT/2pQ9lPrVMAVqgixWBqkz23+6nUV8IEhaNJ lEZREe9lcJPxBMqdGt/jvJOGBRxuHmLGCxGe76w== X-Google-Smtp-Source: AGHT+IEh8ss9k55U8wsX3/8tEAG2SfcGQR8qQbrwzcZ5b4MtukSioGcc66U84K4DfZsDDeA0vxvsanpHjrpCySeVUQA= X-Received: by 2002:a05:6870:6489:b0:296:9c08:51a3 with SMTP id 586e51a60fabf-2a7fb566111mr14422511fac.39.1735403135110; Sat, 28 Dec 2024 08:25:35 -0800 (PST) Received-SPF: pass client-ip=2001:4860:4864:20::42; envelope-from=execvy@gmail.com; helo=mail-oa1-x42.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:297913 Archived-At: Hello. When I enable rust-ts-mode on a rust file, I found treesitter is easy to make emacs buffer to lost color. For example, on the following rust code: ```rust struct Dog { name: String, age: u8, } struct ManyStruct { a: u8, } fn many_code(){ fn fib(n: u32) -> u32 { if n == 0 { return 0; } if n == 1 { return 1; } fib(n - 1) + fib(n - 2) } } fn main() { // change below `//` to `/` to see the difference // { } ``` the rust code is right, and the emacs buffer color is right on every struct/functions. But, if I change `// {` to `/ {`, then the rust code is wrong, this buffer will lost all colors. You can see the change on bellow images: https://imgur.com/a/4Tnv0GJ I suggest emacs can remain colors even if the code is wrong. My emacs version info: GNU Emacs 31.0.50