GNU bug report logs - #79272
[PATCH] rust-ts-mode: handle invalid rust syntax without signaling

Previous Next

Package: emacs;

Reported by: Steven Allen <steven <at> stebalien.com>

Date: Tue, 19 Aug 2025 18:34:01 UTC

Severity: normal

Tags: patch

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Steven Allen <steven <at> stebalien.com>
Cc: Randy Taylor <dev <at> rjt.dev>, 79272 <at> debbugs.gnu.org
Subject: Re: bug#79272: [PATCH] rust-ts-mode: handle invalid rust syntax
 without signaling
Date: Thu, 21 Aug 2025 20:00:06 +0300
close 79272 31.0.50
thanks

> Avoid signaling an error when encountering invalid rust syntax. The
> signaled error would never be propagated to the user (caught somewhere
> in the fontlocking logic, I think) but it would prevent a portion of the
> buffer from being fontified.
>
> Notes:
>
> 1. I encountered  this error in `rust-ts-mode--fontify-pattern' (and
> reproduced it in the attached test). I applied the same fix to
> `rust-ts-mode--fontify-scope' to be safe, but I couldn't actually
> reproduce an issue there.
> 2. `treesit-node-parent' and `treesit-node-type' will blindly forward
> nil so there's no issue calling (treesit-node-type (treesit-node-parent
> node)) even if `node' has no parent.

I couldn't even read your patch without signaling an error :-)

But after applying it as a plain file, the test file opens correctly,
so now pushed.  Thanks.




This bug report was last modified 21 days ago.

Previous Next


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