From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mickey Petersen Newsgroups: gmane.emacs.bugs 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 Organization: Mastering Emacs Message-ID: <87fsbievbi.fsf@masteringemacs.org> References: <83edr3q8ez.fsf@gnu.org> <87o7q7dl4o.fsf@masteringemacs.org> <83a61rq6ck.fsf@gnu.org> <87k00uexdt.fsf@masteringemacs.org> <835yceris5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20587"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e @VERSION@; emacs 30.0.50 Cc: casouri@gmail.com, 61235@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 06 15:14:38 2023 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 1pP2GT-00058m-RT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Feb 2023 15:14:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP2G0-0002fe-H4; Mon, 06 Feb 2023 09:14:08 -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 1pP2Fv-0002Y2-Bw for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 09:14:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP2Fv-0003Bn-23 for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 09:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pP2Ft-0000fY-Sq for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 09:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mickey Petersen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Feb 2023 14:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61235 X-GNU-PR-Package: emacs Original-Received: via spool by 61235-submit@debbugs.gnu.org id=B61235.16756927982488 (code B ref 61235); Mon, 06 Feb 2023 14:14:01 +0000 Original-Received: (at 61235) by debbugs.gnu.org; 6 Feb 2023 14:13:18 +0000 Original-Received: from localhost ([127.0.0.1]:47665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP2FC-0000e3-1k for submit@debbugs.gnu.org; Mon, 06 Feb 2023 09:13:18 -0500 Original-Received: from mail-he1eur04on2127.outbound.protection.outlook.com ([40.107.7.127]:4101 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP2F9-0000df-JT for 61235@debbugs.gnu.org; Mon, 06 Feb 2023 09:13:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JmVM1TR0SHEnbyVoNKTX+4FGd+80YHk5RFswNRWLoynK7Hkxcae5AljieJja7HqYyjSKAUXCCvnpTFaKtmdqrIy0jIUfSwtf18eE2Ditox2oH2gQdtd5tGbsywf7uv1h7SbJMQjGqeEhEyJPUmTCMXJjL5zUOQJXjwDns2ICU5imrBMIRYz0sv6rTKSowsJ2XXrpBZcEmxRv7z7v0bWxvDvEafZKHtdnMCKrqWT8aZSQtQA+bi/MopsQ/VUY++uXVHiAvKBlsej8TtBl9nQTQ8czYajDJ/j9QvdvlsymgLNSrpUMPJ5VEOHBdYBtZje9AkFcQeARoqH9BIyCoHZexA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nL0DVsS6t5fHT301SxFKRQ5YBuZlpWv9qfYd0Mg8d64=; b=OWj+FIP8NdxW32PZsWykZHTYMf+XgWh2YZHiKk41rA0uPptvRbk0ELd1ybfaXFgTe26r8XENYaWgyTv0d+kkrIiPt+UFnxHQcWFPdk/DwTWRCMSRoCUTM7QrBIrn1akvwxo4HQvwldXNr7xWqM+WKHe1C40+sFdqQ3cVKugh6Td9hosQRXqPHFq5ECWt1SPSMOiPoP5/tf9MyFkvsyD1xpGQCfBV3363qr1h1j1ymGsOW/qaQaXCJNYAgmNvO62KC3xNMQfTr7OUGug0xm1e7ZuuEs67lmw21Q0zgWCnR8i/l9cnr72DArCdjZLt6082RmTx9hUSF6GDqNcJYJhAFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 178.79.136.144) smtp.rcpttodomain=debbugs.gnu.org smtp.mailfrom=masteringemacs.org; dmarc=pass (p=none sp=none pct=100) action=none header.from=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semantical.onmicrosoft.com; s=selector1-semantical-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nL0DVsS6t5fHT301SxFKRQ5YBuZlpWv9qfYd0Mg8d64=; b=YzbJ161YFjlzAgcrWcbKQk/+IbobyKOvHY8VZzJhXx9hgYblutLMRTfrKFM2dUwIth9w/wEYM0roGNDJSWCZi22lme4TdNFu0ueJNwIrIdEgpIVBqw6pDXI74c34p093MTf2ctoGfGh2WogKD5Itlp11zYOXXUW1s2qmzPzWNk4= Original-Received: from LO2P265CA0090.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::30) by LO6P265MB6505.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2d9::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 14:13:08 +0000 Original-Received: from LO2GBR01FT003.eop-gbr01.prod.protection.outlook.com (2603:10a6:600:8:cafe::b5) by LO2P265CA0090.outlook.office365.com (2603:10a6:600:8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34 via Frontend Transport; Mon, 6 Feb 2023 14:13:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 178.79.136.144) smtp.mailfrom=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org;dmarc=pass action=none header.from=masteringemacs.org; Received-SPF: Pass (protection.outlook.com: domain of masteringemacs.org designates 178.79.136.144 as permitted sender) receiver=protection.outlook.com; client-ip=178.79.136.144; helo=semantical.co.uk; pr=C Original-Received: from semantical.co.uk (178.79.136.144) by LO2GBR01FT003.mail.protection.outlook.com (10.152.42.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34 via Frontend Transport; Mon, 6 Feb 2023 14:13:07 +0000 Original-Received: by semantical.co.uk (Postfix, from userid 5001) id 8B051114002; Mon, 6 Feb 2023 14:13:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=masteringemacs.org; s=masteringemacs.org; t=1675692787; bh=joCs/LgR6c2yiwRhE9K+OouVSiLyPsYtnW+Erp+SbIA=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=PkS+WaCMOF7ZPB64aaehnwg/f/KeIrbkWKqanz+oirfSQUwkFugg6F4DiAM9C7jMd jUTmd4sSJbm9dZQd2CUTxtKL9SIP9OgyqXF4EIzwq7w+Qt3YHSTI7x9drM3NCOCFdk g+vmTgWKJ31QERBbmU3A/9RZ+uYM7yg2vA9+awCg= In-reply-to: <835yceris5.fsf@gnu.org> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2GBR01FT003:EE_|LO6P265MB6505:EE_ X-MS-Office365-Filtering-Correlation-Id: 1644f462-6b47-4bc0-6672-08db084c4573 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2B4FNi4Gi2mlHJhu2L29KJ6X0Eceyx9RqC5N7OOviSt4BdMxxjyXNOnD+MFbPMUcDBjLizFZYJmdGohX9VABVca6NjbAK1VOd5Ui7HQfMKjix6tpy2Rm6AEMisX3zlJXu1b3Quh4NWdmz4WxzsrKSonHkuCBp+/I3GIRhENauaAi7JhkdHK62m9ClnrqFXvoF8nNY2z6wOBythWcszZWOtFwa8WgfB6gT8eLsdYRm8jMCBZfdHebFOI/A8B+9KRq2C48wR+lPW9Uh3AMyeXQHJHxQtEvQ4WLrKQzCBFTu/xQxWBy3vMDmI4A6b5s3xpSH0bXtiQxzGSmcl1gKnSBP5y79IWZZqGvw9OkkohX9/G5P0cVI76Vn5MldNmv67ub/2eHXtlLsE28N8iqaP881mSYRrqvCb2RwCR/EpJCvvQrNdKB8r9+3OqQSdPz6bL3ihESACx1cAqwqKu9ZRDtsVkp0Y63pQ33JBZ9+H41jd8t3TyJCjhNupOkPGLZ2gO+FAzGrryqrH/vBtxaGjdEKG2/fHsJiS4vmpOQ1hv8YcZ+o4j0zf3Z+hJNxf65vUjwgSGP5oT7Vq5Iat5EeBOy8/Tig59BRL4vtK9UtU0Tqw8XzMYl9xKHtigW3kVpjo9mUu7HFsn0fdkFUjMhfOCx6NqnFW7fRR82a0VRR/A+61H6tzlYLIffJy9fAdBcq/FA9LAO2GoUEFVKskBV7pRX2y/WGGHxrruJnQpLBDbj0j8ABINPSkIYcQt/zHaR6 9+xQIqDK8i5JvjNMAyRd8UjaipJPG2O1niumWjSK4fkt27f7ae3Ldx572bP1Gp1Me3c X-Forefront-Antispam-Report: CIP:178.79.136.144; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:semantical.co.uk; PTR:semantical.co.uk; CAT:NONE; SFS:(13230025)(136003)(376002)(346002)(396003)(39830400003)(451199018)(36840700001)(46966006)(66899018)(36860700001)(8676002)(42186006)(70586007)(4326008)(70206006)(41300700001)(8936002)(6862004)(7636003)(7596003)(356005)(86362001)(316002)(36756003)(6666004)(26005)(186003)(6266002)(83380400001)(2906002)(40480700001)(336012)(82310400005)(5660300002)(47076005)(36916002)(478600001)(2616005)(38230200001)(81973001)(43043002)(79816003)(14776008); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 14:13:07.8315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1644f462-6b47-4bc0-6672-08db084c4573 X-MS-Exchange-CrossTenant-Id: a4e27e3d-bab0-45e8-8942-e64cf9fbd34f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a4e27e3d-bab0-45e8-8942-e64cf9fbd34f; Ip=[178.79.136.144]; Helo=[semantical.co.uk] X-MS-Exchange-CrossTenant-AuthSource: LO2GBR01FT003.eop-gbr01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO6P265MB6505 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:254963 Archived-At: Eli Zaretskii writes: >> From: Mickey Petersen >> 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