GNU bug report logs - #61235
30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser

Previous Next

Package: emacs;

Reported by: Mickey Petersen <mickey <at> masteringemacs.org>

Date: Thu, 2 Feb 2023 19:47:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 29.1

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Mickey Petersen <mickey <at> masteringemacs.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 61235 <at> debbugs.gnu.org
Subject: bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way  to tell if a node belongs to a deleted parser
Date: Sun, 5 Feb 2023 20:24:27 -0800
[Message part 1 (text/plain, inline)]
Mickey Petersen <mickey <at> masteringemacs.org> writes:

> There's no way to tell if a node belongs to a now-deleted
> parser. Checking if it is `missing' or `outdated' returns nil; there
> is no way to ascertain this state except by catching an error if you
> try to get its node text, type, etc.

That sounds reasonable. I can add treesit-parser-live-p, and add
a "live" PROPERTY to treesit-node-check.

treesit-parser-live-p only returns t when the parser is not deleted AND
its buffer is live. I assume that’s more useful than just checking
whether the parser is deleted, for whatever usecase you have?

Eli, should we add this in the release branch or Emacs 30? This
functionality is possible to implement in Elisp, albeit a bit clunky. I
attached a patch of how would it look like (without documentation/test).

Yuan

[livep.patch (application/octet-stream, attachment)]

This bug report was last modified 2 years and 148 days ago.

Previous Next


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