From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Sat, 4 Jan 2020 15:26:01 -0500 Message-ID: <28FDC684-F925-4EF6-A2FE-E7DBDCA3FFEE@gmail.com> References: <83blrkj1o1.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="198392"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 04 21:26:55 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 1inq0d-000pUy-MR for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 21:26:55 +0100 Original-Received: from localhost ([::1]:36646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inq0c-0000pc-Hj for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 15:26:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34063) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inpzr-0008Am-Qh for emacs-devel@gnu.org; Sat, 04 Jan 2020 15:26:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inpzq-0007iB-L0 for emacs-devel@gnu.org; Sat, 04 Jan 2020 15:26:07 -0500 Original-Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:35886) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1inpzo-0007al-RF; Sat, 04 Jan 2020 15:26:04 -0500 Original-Received: by mail-qv1-xf44.google.com with SMTP id m14so1673421qvl.3; Sat, 04 Jan 2020 12:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=igQUvOj17JGUafGlTQ5/+VW1fzjOMPJth6Q/OWv3p0E=; b=idPk9zBgsGVfxQGs2qS0rnZOIoeobr58WtVaLV/eNcaUfzbe6bRiP9RREhrqBZdYox iKew5SXt/cB1vYI8j3J42iMISXc01LChLsJHynY2lybYeXo1nGdz6AZiFoJI9efd2Emr EWZ5dv5iyeUnTJpah7kA8qkD6LWHg4Y0+zhEoxlCmZKNaM7E3eISFCA7yl/iac/ewfli GVrtD08NxUAac/Y88sTK1aL0bXkSmrePr7HmPr8tAufvAFLNfC9Szhkko1t91uVh8KZb abcEbvVsj4vWmyRuy7tYfC+HoHcBwgizEH5qyNolVhRUXe1lxlgxQdkbxeJC3A3bu30P qwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=igQUvOj17JGUafGlTQ5/+VW1fzjOMPJth6Q/OWv3p0E=; b=mQwujIFxym+v27VLaD3DQWNRf1etSgIMIGNcjBPGKdDWyM40fUwPY6RSxfhs3dvvP+ jDyThd16KDf+MhRY8HCQAn0fY4NMNoo3k+6QGgE63s9/J0pkdTaIFGpK9RO9AT7Rs1kv w1joIgc1NToygkNhk1W4yRwQCnnT3gtOolC+cHeVrvUoq1GjTB0EOafXhSpSb8UG31Wv Xp1sRurB02J74wnepqIldcPGHxdXc3GeDbIeWR8YYQCQuqLyF9aKL6XT7dlzSYkX5ZaA QUPer5xpRehgu60RkC9hZkoeYLJb0SgIQMImJbI/aUm3vxMOheKywZlpd+GFoU7vVJBT c/EQ== X-Gm-Message-State: APjAAAUdnW7Lv8Y/pbG0AZk1RwEH/Jcj8GfLP20hZpAx9uKURE/nGWxq rx+LmdxrXlzfOpJLsSbbDKfCC/bpP81yhA== X-Google-Smtp-Source: APXvYqwsOH35fSn5ylyy8VEoqB2D6FimVW+HDCXsIPL4heIn9qFVRmvmAOWQEqKUG27civ6KJncPgQ== X-Received: by 2002:a05:6214:6f0:: with SMTP id bk16mr73874423qvb.23.1578169563611; Sat, 04 Jan 2020 12:26:03 -0800 (PST) Original-Received: from [192.168.1.5] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id m20sm18320919qkk.15.2020.01.04.12.26.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Jan 2020 12:26:03 -0800 (PST) In-Reply-To: <83blrkj1o1.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.40.2.2.4) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 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:243939 Archived-At: > AFAIU, these capabilities could be used as an alternative to > regexp- and syntax-pps-based font-lock, better code folding, > completion, refactoring, and other similar features; in general, any > feature which would benefit from having a parse tree for the source > code in a buffer. Another possibility is modular editing =E2=80=94 syntax-aware word jumps = (M-f/b/d), =E2=80=9Cfree=E2=80=9D expand-regions by parse tree, etc. = I=E2=80=99m not sure about font-locking, but these types of operations = needs only a parse tree. So I think it suffice to simply provide this = parse tree and let packages use it like (syntax-ppss): provide functions = that returns the syntax object at point (cl-struct?) and functions can = extract informations from it, like position of beginning and end, type, = previous/next object, nested level, etc. I=E2=80=99m not sure how refactoring could work (accurately), tho. Maybe = it=E2=80=99s better to leave refactoring to lsp servers. In general, I = think we should leave tasks that requires a deeper understanding of the = semantics of the language to lsp. Yuan=