[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell i
From: |
Yuan Fu |
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 |
Mickey Petersen <mickey@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
Description: Binary data
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Mickey Petersen, 2023/02/02
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser,
Yuan Fu <=
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Eli Zaretskii, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Mickey Petersen, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Eli Zaretskii, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Mickey Petersen, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Eli Zaretskii, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Mickey Petersen, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Eli Zaretskii, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Yuan Fu, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Eli Zaretskii, 2023/02/06
- bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser, Yuan Fu, 2023/02/06