From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Sun, 5 Jan 2020 14:50:02 +0000 Message-ID: <20200105145002.GB71296@breton.holly.idiocy.org> References: <83blrkj1o1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="174642"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , "emacs-devel@gnu.org" To: arthur miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 15:50:59 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1io7F3-000jF1-Un for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 15:50:58 +0100 Original-Received: from localhost ([::1]:42736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1io7F2-0005mI-EQ for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 09:50:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43378) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1io7EJ-00050x-MI for emacs-devel@gnu.org; Sun, 05 Jan 2020 09:50:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1io7EI-00054R-Dx for emacs-devel@gnu.org; Sun, 05 Jan 2020 09:50:11 -0500 Original-Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:37234) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1io7EG-0004y0-Jz; Sun, 05 Jan 2020 09:50:08 -0500 Original-Received: by mail-wr1-x431.google.com with SMTP id w15so34302848wru.4; Sun, 05 Jan 2020 06:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=vm9dZkLaIEI/TVuTOJf7qjbA5UlRzHra803Q3DGDEFg=; b=DbdWYhsRXdywtWr3LzAmwBijqx9e1k0a7gHhD+lyYA+DBrNAoHxDHntk6n/5OFm/y2 v1gEkoimQKpGwuyEYURQOEzZUTPC3qGyzfkO/larjXal4Uk4BacRCsMVt7pG1m6b/4aS djwcygzUVkpGzW/59WzfSpNb4GH0TqBS8q9snAjAV810w45gMYXTN6FTp9ACIDT0+dJf 3lLTTxzBtT5W3rohCXQ4Crip83rsbU7Ba6SsxDaGBBG+AczY+JRHP6nqwUqVm9cbERzY PDFGdUDE545VZVFbJU6+vVQdusPj0xb7yJwrVewG2gfWfkDF+P/kvWIYrxJpDSc4d1dN MMXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=vm9dZkLaIEI/TVuTOJf7qjbA5UlRzHra803Q3DGDEFg=; b=XrCFOm5pDAnqvI+iRM5CXIvmjYELggM4SG1lMwSAbSLQ8wiI7Of6+fZaZVKEdVQW6f jPxr3bIp104JLhQPFjIn/Jf4EYdBMWhMg3lguS82uM9m+4DUNQS1nphHbIBZViKePlMG ql5uYBGQObyNIavAuPW6mc/8X1aOKKmfB59k5VIr/aJaQum4yABN3GlUZ+2MA7aJNtr1 RqqztYDUzbYdz4KkoHCVKm+ojwSjvvZN7Q8EAkS62bF+wnn+oWwABdC4g8wQcCBpP7QW O3iF+vlUoZqVRJ00HD4dUvXNJvS7ll3UKCHY3dwoJBkJ5RbPyruqRXXAgULtJMmK+pw8 AFtA== X-Gm-Message-State: APjAAAVPGpHWTwpAKow68vwJu7mL66KROowIDtLwGjMxheyH3UTu0Moq tusVXwZYNCRXkAsa79WqD3Q= X-Google-Smtp-Source: APXvYqydf7o1TZxGr95FiPKkKhTqRG4OYm4fBSpUjajTm8qplyuxg/br7iuPYdSbJhPD9T+3L0Ly3w== X-Received: by 2002:adf:fa12:: with SMTP id m18mr94804815wrr.309.1578235806373; Sun, 05 Jan 2020 06:50:06 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-3c68-1d99-a68c-dce7.holly.idiocy.org. [2001:8b0:3f8:8129:3c68:1d99:a68c:dce7]) by smtp.gmail.com with ESMTPSA id o4sm68161078wrw.97.2020.01.05.06.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2020 06:50:05 -0800 (PST) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243975 Archived-At: On Sat, Jan 04, 2020 at 02:46:14PM +0000, arthur miller wrote: > > There is a very good presentation of tree-sitter on YT by its author: > > https://www.youtube.com/watch?v=Jes3bD6P0To > > Looks much better then what I got a picture by just reading on the > website: I watched this video and it looks to me like tree sitter is trying to solve a fundamentally different problem than LSP servers. Most of the conversation in this thread seems to make the assumption that tree sitter and LSP are mutually exclusive, which is clearly not true. Tree sitter provides a fast and accurate parse tree to the editor which it can then use for syntax highlighting, moving by syntax element, code folding, expand region, etc. LSP does not provide that and possibly never will: https://github.com/Microsoft/language-server-protocol/issues/682#issuecomment-486676262 Tree sitter does not provide error checking (although it does some basic syntax checking simply through being a parser), language aware refactoring, completion, etc. Things that LSP DOES provide. One of the things that interested me the most in that presentation was the discussion of syntax highlighting on very long lines. Perhaps it couldn’t help Emacs, but it certainly made me think. -- Alan Third