From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: tree-sitter version? Date: Fri, 25 Nov 2022 07:08:07 -0800 Message-ID: <25472.55895.937365.654317@retriever.mtv.corp.google.com> References: <70973BD9-26D2-4833-A429-8434FC03026B@gmail.com> <87cz9cevns.fsf@gnu.org> <8B97AC7B-54CF-41AC-9EF7-0A83F1709B98@gmail.com> Mime-Version: 1.0 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="35113"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tsdh@gnu.org, raman@google.com, emacs-devel@gnu.org To: casouri@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 25 16:08:37 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oyaJh-0008w3-G1 for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 16:08:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyaJS-00008Q-90; Fri, 25 Nov 2022 10:08:22 -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 1oyaJI-0008Sp-Ss for emacs-devel@gnu.org; Fri, 25 Nov 2022 10:08:14 -0500 Original-Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyaJH-0007fN-5f for emacs-devel@gnu.org; Fri, 25 Nov 2022 10:08:12 -0500 Original-Received: by mail-pg1-x534.google.com with SMTP id v3so4187005pgh.4 for ; Fri, 25 Nov 2022 07:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:from:to:cc:subject:date :message-id:reply-to; bh=uQ4z+75t1JmtepVkeIEOuos1cP9Mm4mUsGPbzP+St5g=; b=d3Fe2H+Y2cLzmVxILil649vo4ujzdY5+L8mqh+hW0X0bq2mTGiQYoMrKvHb9rkjZwx voiOCF+U+78uTmAXy9MYqGt0HjYnv3uOvS4i27FDvo66lIHHCUfRMwJM2hGBsUibcOPb wEheNGsHPrAq2wb2adkU1Geq+pPia615CMUd7Sfc74EzfrkQU0QFQNOFjVU8LuhMM8Fo +QHcw2pr9u8x/095oTocf45V+GB48MTr2UcFt47aWLCY4S5okraiu4vwzwruBfVlIdD/ sE+FNa0ImZr/SDVshP3ExJCBqP80SpItknaVeIpcP5/HaqpMUZGhqf4rU0Q5BMYsLO0d JGQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uQ4z+75t1JmtepVkeIEOuos1cP9Mm4mUsGPbzP+St5g=; b=5yRW2qRZl2SQb79nbkkHVaW2LXW/5qZwCXiPGtVrSvMKRbW1EgjCo1M+R2HcS9ycuF M/172PbXQRiEJgA8bt+5oXezmkD+/64VeR8tCg7bkPMst0ToxyxyTP6SrPRYVgW1XTPw SYvupQ68shsFT69puQu/JyM90hYqCbXoGGVV/e7Z5NM4S4OlwSRWCKVicTfTULRS5i8S n2eEksfyBYQNEuAiSljd9pDp3hJKyts+6ZQ58tYycbpihHhStXJDUc01HeohrNbJ4R7k BVuH0XSwSDU4h40PsrJevS0+C2L2PgFXWHTbmSoQHYnIcb3yBiY0pqZSI7oMG78X3rLc DoTA== X-Gm-Message-State: ANoB5plgIYDV2qcWgLMLYAInw4illjZdCqJVrux1mUl9M3U8dk/tShoK y0TVuuDIyWp7ignN9ukzW1J1yzVif3V0Rw== X-Google-Smtp-Source: AA0mqf6LyVE+rupAuzeEQQSQu+Yh3iZ1rpNSrCZ0QEpsoc5Prv3gu0k1WwWerB8IdxSh18aqaMqRwg== X-Received: by 2002:a63:4d15:0:b0:477:ae0c:ec3c with SMTP id a21-20020a634d15000000b00477ae0cec3cmr13586763pgb.520.1669388889269; Fri, 25 Nov 2022 07:08:09 -0800 (PST) Original-Received: from retriever.mtv.corp.google.com ([2620:0:1000:1612:edea:9bda:be07:3ba7]) by smtp.gmail.com with ESMTPSA id nm18-20020a17090b19d200b001fd6066284dsm3081267pjb.6.2022.11.25.07.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 07:08:08 -0800 (PST) In-Reply-To: <8B97AC7B-54CF-41AC-9EF7-0A83F1709B98@gmail.com> X-Mailer: VM 8.1.1 under 29.0.50 (x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=raman@google.com; helo=mail-pg1-x534.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300485 Archived-At: also the name "ts" as part of tree-sitter is an unfortunate confusion since ts-mode is for typescript. I initally wrongly assumed that ts-mode was some kind of global mode that would enable tree-support for all supported modes, given the names c-ts-mode etc.Yuan Fu writes: >=20 >=20 > > On Nov 23, 2022, at 9:54 PM, Tassilo Horn wrote: > >=20 > > Yuan Fu writes: > >=20 > > Hi Yuan, > >=20 > >>> So: am I supposed to install tree-sitter from github or from deb= ian's > >>> package manager=3F > >>=20 > >> Either should be fine. > >=20 > > Ah, I was wondering the same when I wanted to give tree-sitter a t= ry. I > > have tree-sitter 0.20.7 installed but the configure output said > > ">=3D0.20.2 no" but only reported a >=3D 0.6.x version. It still = works > > fine. :-) > >=20 > >>> I first did the package-manager version, then pulled from github= and > >>> installed that -- configure shows that tree-sitter is detected -= - but > >>> calling any of the tree-sitter modes, eg c-ts-mode barfs with an= > >>> error saying that support is not available. > >>=20 > >> If you call tree-sitter-available-p, what do you get=3F Most like= ly you > >> don=E2=80=99t have the relevant language definition/grammar for t= hose > >> modes. You can probably find them on package managers, or you can= > >> build with the script here: > >=20 > > Indeed, that was the next trap I fell in. On Arch, tree-sitter is= in > > the community repository (so basically almost official) whereas th= e > > language definitions are only on the AUR. Maybe the NEWS entry sh= ould > > tell more clearly that tree-sitter needs to be system-installed an= d also > > the language definitions need to be grabbed somewhere. >=20 > Yeah there will be a NEWS entry for tree-sitter. >=20 > >=20 > > BTW, how can a user decide that tree-sitter modes should be used=3F= For > > example, when I open a json file I get js-json-mode, not json-ts-m= ode, > > which also works, so support is available. Should user's augment > > auto-mode-alist=3F Or is there some "enable TS whenever possible = and the > > devs think its support is in a usable state for that language" tog= gle=3F >=20 > There is no global toggle, unfortunately. You could use auto-mode-al= ist or major-mode-remap-alist to enable tree-sitter modes, yes. I imagi= ne there could be a third-party package that automatically enables tree= -sitter for all supported nodes, maybe. >=20 > Yuan --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =E2=99=89 Id: kg:/m/0285kf1 =F0=9F=A6=AE -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♉ Id: kg:/m/0285kf1 🦮