unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mickey Petersen <mickey@masteringemacs.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: casouri@gmail.com, 61235@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: Mon, 06 Feb 2023 14:08:46 +0000	[thread overview]
Message-ID: <87fsbievbi.fsf@masteringemacs.org> (raw)
In-Reply-To: <835yceris5.fsf@gnu.org>


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Mickey Petersen <mickey@masteringemacs.org>
>> Cc: casouri@gmail.com, 61235@debbugs.gnu.org
>> Date: Mon, 06 Feb 2023 13:19:57 +0000
>>
>> > I'm asking why the Lisp program cannot track the parsers its uses and
>> > deletes, and instead expects the core to do the janitor's job for it.
>>
>> Because I have a proxy-like object of a real node because they're
>> invalidated if a buffer is edited, even if the parcel of code I hold a
>> node reference to is untouched. That's just how tree-sitter works, so
>> I deal with it like this. That part works fine for I can of course use
>> `treesit-node-check' to determine if it's outdated and thus needs
>> refreshing (or not.)
>>
>> The problems begin when the parser is also, for one reason or another,
>> destroyed.
>
> But it is only destroyed if your program calls treesit-parser-delete,
> no?
>
> Anyway, I'm okay with exposing treesit_check_parser to Lisp, if you
> really insist.  But please be sure you want to insist, because I'm not
> really convinced.

All I want is a way for treesit-node-check to tell me if the node
belongs to a dead or alive parser. It is already capable of telling me
if a node is outdated, for instance, another rather important feature.
Knowing its status is pertinent if you do any sort of light
refactoring or if you end up destroying a block of code that has its
own nested parser.

Whether I destroy a parser explicitly (which is how I found the issue)
or indirectly (through some other mechanism) is, I think, orthogonal
to the problem of determining liveness (of a node, of a process, or
any of the `xxxxxx-live-p' functions we presently have)

Thanks,

Mickey





  reply	other threads:[~2023-02-06 14:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 19:46 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  4:24 ` Yuan Fu
2023-02-06 12:34   ` Eli Zaretskii
2023-02-06 12:35     ` Mickey Petersen
2023-02-06 13:19       ` Eli Zaretskii
2023-02-06 13:19         ` Mickey Petersen
2023-02-06 14:05           ` Eli Zaretskii
2023-02-06 14:08             ` Mickey Petersen [this message]
2023-02-06 15:21               ` Eli Zaretskii
2023-02-07  3:00                 ` Yuan Fu
2023-02-07  3:31                   ` Eli Zaretskii
2023-02-07  4:55                     ` Yuan Fu
2023-02-07 12:24                       ` Eli Zaretskii
2023-02-08  3:54                         ` Yuan Fu
2023-02-07  8:03                   ` Mickey Petersen
2023-02-08  3:52                     ` Yuan Fu
2023-02-08  8:41                       ` Mickey Petersen
2023-02-10  1:28 ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsbievbi.fsf@masteringemacs.org \
    --to=mickey@masteringemacs.org \
    --cc=61235@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).