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#61529: 30.0.50; tree-sitter: weird off-by-one error but only in css-ts-mode(?) with `treesit-node-at' Date: Wed, 15 Feb 2023 13:42:51 +0000 Organization: Mastering Emacs Message-ID: <87h6vnjath.fsf@masteringemacs.org> References: <87mt5fjpwu.fsf@masteringemacs.org> <83v8k3avv8.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="6554"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e @VERSION@; emacs 30.0.50 Cc: 61529@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 14:53:33 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 1pSIE0-0001U6-Sp for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 14:53:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSIDa-0001A7-Sy; Wed, 15 Feb 2023 08:53:07 -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 1pSIDX-00019L-Ay for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 08:53:03 -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 1pSIDW-0001Ud-Hs for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 08:53:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSIDW-0001Q1-ER for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 08:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mickey Petersen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 13:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61529 X-GNU-PR-Package: emacs Original-Received: via spool by 61529-submit@debbugs.gnu.org id=B61529.16764691265368 (code B ref 61529); Wed, 15 Feb 2023 13:53:02 +0000 Original-Received: (at 61529) by debbugs.gnu.org; 15 Feb 2023 13:52:06 +0000 Original-Received: from localhost ([127.0.0.1]:58278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSICc-0001OW-8s for submit@debbugs.gnu.org; Wed, 15 Feb 2023 08:52:06 -0500 Original-Received: from mail-db8eur05on2138.outbound.protection.outlook.com ([40.107.20.138]:45152 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSICa-0001Nw-4b for 61529@debbugs.gnu.org; Wed, 15 Feb 2023 08:52:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a5GUMwNTR3agzpaYefjd5L29aHd+40EOss6KPx2YmX/1E9nRvYcnro4hOt+6sqVuYWXnU6+8RbShGhrlVgvbMQ3e+KscVLcP2ApWxvH758usiSGhSjPiCdSAmvTT7A9Tsna/usM+wX6TlecjDmhQ9XbtoHWVu+2ABrdlHB88fZ2pSQHgCw+NkXS8Odg3QdkZdRyiVQ9FCMxZ3eJJG1PwQBg7tEQUz0MTK0InH+TnZ49BIIxK1jXQ3m0F8t7EBjd/ShRGfMHbiAwy8/to6hBQQ88AnT0Xamc/azPNEUQHUNRBlW0JArVEnTuttnwdV+0Rdzjohi9LdXNIPBjWC3b2Sg== 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=hiclVXuoNL+rZpnvCJLOsoF3CGS0+1aK9prCJqrfgT4=; b=TXESQgyqXrfxYrRqpuutVkUQgQB2wYDfHyo9IkkpVHALD+2EyDR7OY204dd+YarN7M7Rl63JpVpKQAYBnw/HovNTqCU/0KRlBpwkxJi4kb/+9L+AIJu9ekPHNZqyrLAxAcKTF0cv68x5+4HOqgq1ew3b+mYmMjz9C17dlW/e15XjYyv0JDlcHY7xEtmNXZyjbPbA3nIvtIrZcufQg1vNkImWIT+krHdmBBaG8bUK0sEsqchL6jxfALa2cY99MUaoR11c3jxgmD2KZvJLx73GnBIwOJK8UwX7mG/InuAhvCT7/8KDVotY2sPJg24LN1VcCDCPz1Q9+ckSqKqPYhe0aQ== 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=hiclVXuoNL+rZpnvCJLOsoF3CGS0+1aK9prCJqrfgT4=; b=Fhtvw9yVhsfXCGRPGrLvPsgtEM5qcNST/HvnfhpDFdmmjtjKJppEOe3aNyI8CnGjxW5fZtau5XCaJklQTuPt7SMzG3wHMsfI1VPsQI8+1vwfl0+CKWTe2eWZcftgcndx9Ha7GcIBK9rzo/bZZamPXBOR7zaLTlSZEWBx7k/52oc= Original-Received: from LO4P302CA0019.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c1::11) by LO6P265MB6459.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2df::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Wed, 15 Feb 2023 13:51:57 +0000 Original-Received: from CWLGBR01FT038.eop-gbr01.prod.protection.outlook.com (2603:10a6:600:2c1:cafe::24) by LO4P302CA0019.outlook.office365.com (2603:10a6:600:2c1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26 via Frontend Transport; Wed, 15 Feb 2023 13:51:57 +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 CWLGBR01FT038.mail.protection.outlook.com (10.152.40.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.12 via Frontend Transport; Wed, 15 Feb 2023 13:51:56 +0000 Original-Received: by semantical.co.uk (Postfix, from userid 5001) id 68F8D114002; Wed, 15 Feb 2023 13:51:56 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=masteringemacs.org; s=masteringemacs.org; t=1676469116; bh=t0Y4yksmo7H960+A6qqTpFC29uFxBqYbjPoxTqa7Ddk=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=fBg1vs2dOPuPUF03veh4mWUZF5Hotz1/QeIENk4pihBI8MqxfO5eTJh4LfYOA5VLj Qz6ol9aSyJn5QtfUHgoOIePFaitxcs8yycOLHf6l5R5kG7asqU0PstWHuCRfKBeqm+ ZHvELxOlFjJ0Rpc5KyxYMk6xbgxl7wCfvW/0qFHQ= In-reply-to: <83v8k3avv8.fsf@gnu.org> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLGBR01FT038:EE_|LO6P265MB6459:EE_ X-MS-Office365-Filtering-Correlation-Id: 68c36bbd-b9b2-47c2-b3ac-08db0f5bcd87 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KIEQkURcbEgPI4kKso0GO9s7wcIm8nWFNNrEttXuEtj8womTp2ghGA/GlP2DyWrRf8hjX31pDS6k6BwST0aLlh1cNqe1od8zDj0q1Gu5mOZAkcWpA+lJJlz3Gq3OCvjVrFwfrYQsFQVYbmOitokozREnpbNoLqOmvuA9De7THjCRNu3iPwAYRLkYCQ7w08sGCtm/FO8IRlpVEzF9s/z42f7gapfPY43XIZr30gFn23vUzqQyPzFL+HvdHvNyb7jftSUmfm9AlWPuH40Et8jarXl4D5UiV0ZeHYhUQBQr2h4J/zj2d+zEEqXeO/0tbs5PtA28LPYwgbj4dfhPGFTwreLY70F/d5/UI7zCz9V9pFG6Udl2nSJHJOds9cn3Bg39l9SK/yhz7PH2Wc4Ddm3t/uSpk8gF/5YDfmtmGAZv8zj9ON7hTbGXA3f4xpw1Cd1HiBPuBXyZ82SyyJbrYjkvYCg/ZgxtnBAuJC1+6dsOgnHv4ihL3/WlaXmsnZNpfF1IF0d5vHgBnFZWKpCWG8/eSm19rq6X1SyZagQTAXGbzIiLFmpvcsWsCZhSe27hV0U4IdXLfAv+XjqM8aDDazj/xjF1lW049C6S4E4rig2Q9QswvwELlaVnECNk84ATNIjFMSgiOcDe+WiNRXw2Dn37e7aerIIOSAkvOY610uEM3bnofxuTwfjZUfEFV3Nt/dZEnIhEjgbFCG6UZAXIVCAhsJiZzfk1XzBX3+3lpOnqQbqSZkOXwsPDC0C9+ve+i +y/fSfz+CVWA7AGMdk5WqV7Iw== 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)(396003)(39830400003)(376002)(346002)(136003)(451199018)(46966006)(36840700001)(36756003)(316002)(36916002)(42186006)(478600001)(26005)(6666004)(5660300002)(2906002)(70586007)(4326008)(41300700001)(70206006)(8676002)(6862004)(8936002)(186003)(86362001)(7636003)(36860700001)(7596003)(40480700001)(356005)(336012)(6266002)(2616005)(47076005)(82310400005)(38230200001)(81973001)(79816003)(14776008); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 13:51:56.7345 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68c36bbd-b9b2-47c2-b3ac-08db0f5bcd87 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: CWLGBR01FT038.eop-gbr01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO6P265MB6459 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:255703 Archived-At: Eli Zaretskii writes: >> From: Mickey Petersen >> Date: Wed, 15 Feb 2023 08:25:53 +0000 >> >> >> With point at '2', then I'd expect `treesit-node-at' to yield that node. But it does not: >> >> (cons (point) (treesit-node-at (point))) >> >> => (34 . #) > > The value of point is the number of the character which _follows_ > point, yes? So when the cursor is on '2', point is actually between > '(' and '2'. Right? What does this mean in terms of the node that > should be returned by tree-sitter? Correct, point is between '(' and '2'. So 34-35 means it occupies position 34-35 or [34,35). So point is outside the scope of the '(' single-char anonymous node. Or at least it should be: the problem is that it *is* inside it in this one weird instance and, near as I can find, only in this mode, and then only in this place, it isn't. I suspect `treesit-node-at' has a bug. Consider: a { background: linear-gradient(210deg, rgba(|255,82,41,1) 0%, rgba(251,165,85,1) 54%, rgba(163,73,73,1) 100%); } Note the new position of point in rgba. `treesit-node-at` with `(point)` now correctly returns # Move point back one position: a { background: linear-gradient(210deg, rgba|(255,82,41,1) 0%, rgba(251,165,85,1) 54%, rgba(163,73,73,1) 100%); } And now: (treesit-node-at (point)) => # In start contrast to the original example.