From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#75456: 31.0.50; Cannot find the definition of the predicate in `treesit-thing-settings'" sexp-list) Date: Thu, 9 Jan 2025 19:23:42 -0800 Message-ID: References: <2719520.lGaqSPkdTl@3-191.divsi.unimi.it> <87msfzvox7.fsf@mail.linkov.net> <19750222.fSG56mABFh@fedora> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39638"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75456@debbugs.gnu.org, Juri Linkov To: Vincenzo Pupillo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 10 04:25:18 2025 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 1tW5e9-000A9k-1d for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jan 2025 04:25:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tW5e0-0006QP-OU; Thu, 09 Jan 2025 22:25:09 -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 1tW5du-0006Ku-Ge for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2025 22:25:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tW5du-0005fS-2C for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2025 22:25:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=2cstiCIgPLqgShjPw5gPAvZNwrMY5bKpWddtn9g3Ki0=; b=swywcBodWE2fXhTt4EoB3guE4F0WmvU8BIEugs5w0Ploe9ZMs8nqlbXvpwarOSPeW5hNcJ6rUAziE07uYQcsjI4M1Bc+eCn9W4tsSuhX7kam7fRWIZeOdyJRvpo20w1bOWXoMhNDpW1adtM8L6UYZNjQzmrqgEYw6QKw0A2VHosB1Ps0/ggk0NhZLxRIH8BkKgfBkuxlShaAY17C9fRTlQll3S3Nil7o9PmuwMEdwi6Bk99OE6zOJ3B7Wxaj/GGFNJHYg72qhrr1jIuqwI7iXL25wURjdQ/ENeCqWO5Ji3ZRqyuq0a3+tN12XNmKyRZCl687ec6GvrmlC0Y43kpy6w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tW5dt-0007Bw-Sq for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2025 22:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jan 2025 03:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75456 X-GNU-PR-Package: emacs Original-Received: via spool by 75456-submit@debbugs.gnu.org id=B75456.173647944227559 (code B ref 75456); Fri, 10 Jan 2025 03:25:01 +0000 Original-Received: (at 75456) by debbugs.gnu.org; 10 Jan 2025 03:24:02 +0000 Original-Received: from localhost ([127.0.0.1]:55954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tW5cw-0007AR-3v for submit@debbugs.gnu.org; Thu, 09 Jan 2025 22:24:02 -0500 Original-Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:42341) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tW5cu-00079z-7A for 75456@debbugs.gnu.org; Thu, 09 Jan 2025 22:24:00 -0500 Original-Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2167141dfa1so28446755ad.1 for <75456@debbugs.gnu.org>; Thu, 09 Jan 2025 19:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736479434; x=1737084234; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2cstiCIgPLqgShjPw5gPAvZNwrMY5bKpWddtn9g3Ki0=; b=GKrgRPXFd4DSVK5To2Xcn6yDMJn3Uyfy2IPxhbduu61xDpWXnLSq9+U/jOXv6vBLkz tD4IPFmpkR8NfAvP3onoWwZqMPR3ufr/CGQwRHIk8chIJsorpkrQw+D1yqr6KpYEeHC1 G4n81AcjRYVnqynRClWAz8uAQqdeyrv9OP5m0X1uX41VC3iSY4vpe93ThyFdJRA4b0br 2kON9rjQjsgHi0gz0aVmriZV0OiaNUmwqrSxdl5rKPJEF9mryFjkPHqZpphJhSXVHlgt YWGgfSJdwVMN/08Vi1u9XTAYRQpt1OyJJE+sZ1u1YxUrdjLtP3LqFX4EpOCNpOR7XBQl 26/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736479434; x=1737084234; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2cstiCIgPLqgShjPw5gPAvZNwrMY5bKpWddtn9g3Ki0=; b=O2PlgasClOt434SoO9EW+/d7/UR6NfTYNBXGa01xp2zBqFjWgy6ZK8hx0owRPPDjWK FCQJk1urX+kaOEGEI0g/HAG5lur4TeHxS10wUvsWDa9ncmUXYmUvsy5tFqAR3H2WZrns QSqgzoMfN0uGuIKk69Bx6La4Y2zzE3exQrAk5E30PRkIykMpi2TKRgdmC6K8s4z6rYHq Fea7J0Jf9Tz4SAMq/Mfusldyd8jvdD+REUbAEuJhWwj5DuMlYDRAdsObqFHkEhf/+WaS Yu1Za02Jl8XwbdIYA0v0AKf0TsjbCNbtHzVYS4oSFNs3vonG9HnRdX/6HmJPDMbUaXBj L1RA== X-Forwarded-Encrypted: i=1; AJvYcCV4Oxrf9dgQm9n6zu1clvEA2bL20G+15ml0PqIjtN1EAQsAKrSSN82R9bDf8LmcoFiuTNx5Yw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzDkCA5w5FS3w/rkX78V7qCT2kcYgV8hAhqfA8PHE1ySyPcBJsB 0ZJsZMO4HCqbfvIPIKxgwTcIQRlEpMy1s0+xw1yQJbLRzYRaluxf X-Gm-Gg: ASbGnctr/gjRaNL13CuklBPx1NyrmnpkL5C9n+jC42+C6nNjvqjwoMJ3Ux1pr7AimRb 1cTn7ikkVu/xY9dwEUvR8sp7kzYX20WpnFzrtKUoh6GIzZpnBhfBzr8QmKpu0vMI3MWHIj4GA5p NbURmHmp9mL0Xq9rfjJ6/NL/RPO56MNNktVs188yZeO2oQ5ytfWdtnbR3KQxvcR2GgUzGITksXU 0qIju46ARwwZbp6vm5iZPRFFKPvciO986HwxNMMh6SESumWTsH/f8+dPrMrjtqMoqRZpgdd8oFz GnDV X-Google-Smtp-Source: AGHT+IEY5luWQ+es15rAWJ1jLcJfxnHFWzFuxsTPjjz4axnmVXuT/I0DU//GggtXn0/LDiI8VmTsKQ== X-Received: by 2002:a17:902:c403:b0:216:33f0:58d5 with SMTP id d9443c01a7336-21a8d6c7ca5mr79733815ad.17.1736479433976; Thu, 09 Jan 2025 19:23:53 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:d801:ab3e:9baf:5ef1]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f10e2c6sm4927905ad.33.2025.01.09.19.23.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jan 2025 19:23:53 -0800 (PST) In-Reply-To: <19750222.fSG56mABFh@fedora> X-Mailer: Apple Mail (2.3776.700.51) 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:298862 Archived-At: > On Jan 9, 2025, at 2:42=E2=80=AFPM, Vincenzo Pupillo = wrote: >=20 > Ciao Juri, >=20 > In data gioved=C3=AC 9 gennaio 2025 19:10:28 Ora standard = dell=E2=80=99Europa centrale,=20 > Juri Linkov ha scritto: >>> Ciao, >>> this problem occurs with js-ts-mode when jsdoc is enabled. Occurs = when you >>> place the cursor in a comment highlighted by jsdoc. >>> This is the error message: >>>=20 >>> "treesit-show-paren-data--categorize: peculiar error: ("Cannot find = the >>> definition of the predicate in `treesit-thing-settings'" sexp-list)" >>=20 >> Recently I fixed bug#75198 and tested it on your mhtml-ts-mode >> where it works nicely, and (treesit-language-at (point)) >> returns e.g. 'css' on embedded css. >>=20 >> However, now I discovered that (treesit-language-at (point)) >> returns 'javascript' on embedded jsdoc parts of a js file. >>=20 >> I wonder is this intended? >>=20 >> Since 'treesit-node-match-p' uses node's parser, I could use >> (treesit-parser-language (treesit-node-parser (treesit-node-at = (point)))) >> that returns 'jsdoc'. >>=20 >> But first I'd like to know why treesit-language-at doesn't return the = same? >=20 > Local parsers, like jsdoc or phpdoc, are "ignored" by several = functions used=20 > by treesit. But I don't know in detail how treesit works. > I tried to return local parser languages =E2=80=8B=E2=80=8Bin the = past, but both indentation=20 > and font-locking got messed up. > I just tried and the result is the same (maybe I did something wrong), = and=20 > then treesit-parser-list also returns jsdoc as if it were a global = parser. >=20 > @Yuan can be of more help. >=20 > Thanks. >=20 > Vincenzo If local parsers somehow doesn=E2=80=99t work, it=E2=80=99s a bug. What = are the functions that ignore local parsers? And how exactly does = indentation and font-lock mess up? For indentation, there=E2=80=99s a special condition: if the largest = node at point is a root node for the local parser, we don=E2=80=99t use = it for matching indent rules, because it=E2=80=99s impossible to figure = out how to indent it; instead, Emacs uses the host parser=E2=80=99s node = at that point. (The logic is in treesit--indent-largest-node-at). What do you mean by treesit-parser-list also returns jsdoc as if it = were a global parser? Does it return the jsdoc parser even you pass nil = to the TAG parameter? If so, I think it=E2=80=99s because some treesit = function accidentally created it when looking for a parser for jsdoc. = I=E2=80=99ll try fix that. Yuan=