From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: ~johnmuhl Newsgroups: gmane.emacs.bugs Subject: bug#65672: [PATCH emacs 1/1] Add lua-ts-mode Date: Thu, 31 Aug 2023 16:32:06 -0500 Message-ID: <169352253839.28940.16024479871485106701-1@git.sr.ht> References: <169352253839.28940.16024479871485106701-0@git.sr.ht> Reply-To: ~johnmuhl 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="5562"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ~emacs/emacs-devel@lists.sr.ht To: 65672@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 01 08:31: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 1qbxgr-0001H7-5w for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Sep 2023 08:31:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbxgg-0007IA-1a; Fri, 01 Sep 2023 02:31:22 -0400 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 1qbxgE-00074B-OO for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 02:31:03 -0400 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 1qbxgE-0001vT-Di for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 02:30:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbxgN-0003mM-1j for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 02:31:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: ~johnmuhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Sep 2023 06:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169354983214451 (code B ref -1); Fri, 01 Sep 2023 06:31:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Sep 2023 06:30:32 +0000 Original-Received: from localhost ([127.0.0.1]:59724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbxfo-0003kt-NK for submit@debbugs.gnu.org; Fri, 01 Sep 2023 02:30:32 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:58450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbqa0-0000vI-AG for submit@debbugs.gnu.org; Thu, 31 Aug 2023 18:56:01 -0400 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 1qbqZk-0003hQ-BE for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 18:55:44 -0400 Original-Received: from mail-b.sr.ht ([173.195.146.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbqZg-0002hm-FM for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 18:55:44 -0400 Authentication-Results: mail-b.sr.ht; dkim=none Original-Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id C964011F2FF; Thu, 31 Aug 2023 22:55:38 +0000 (UTC) X-Mailer: git.sr.ht In-Reply-To: <169352253839.28940.16024479871485106701-0@git.sr.ht> Received-SPF: pass client-ip=173.195.146.151; envelope-from=outgoing@sr.ht; helo=mail-b.sr.ht X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 01 Sep 2023 02:30:26 -0400 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:268866 Archived-At: From: john muhl * test/lisp/progmodes/lua-ts-mode-tests.el: * test/lisp/progmodes/lua-ts-mode-resources/indent.ert: * lisp/progmodes/lua-ts-mode.el: New file. * lisp/progmodes/eglot.el (eglot-server-programs): * lisp/progmodes/hideshow.el (hs-special-modes-alist): Add support for lua-ts-mode. * admin/notes/tree-sitter/build-module/batch.sh: * admin/notes/tree-sitter/build-module/build.sh: Add Lua grammar. * test/infra/Dockerfile.emba: * test/infra/test-jobs.yml: Add lua-ts-mode tests. --- admin/notes/tree-sitter/build-module/batch.sh | 1 + admin/notes/tree-sitter/build-module/build.sh | 3 + etc/NEWS | 4 + lisp/progmodes/eglot.el | 2 +- lisp/progmodes/hideshow.el | 1 + lisp/progmodes/lua-ts-mode.el | 457 ++++++++++++++++++ test/infra/Dockerfile.emba | 1 + test/infra/test-jobs.yml | 1 + .../lua-ts-mode-resources/indent.erts | 152 ++++++ test/lisp/progmodes/lua-ts-mode-tests.el | 32 ++ 10 files changed, 653 insertions(+), 1 deletion(-) create mode 100644 lisp/progmodes/lua-ts-mode.el create mode 100644 test/lisp/progmodes/lua-ts-mode-resources/indent.erts create mode 100644 test/lisp/progmodes/lua-ts-mode-tests.el diff --git a/admin/notes/tree-sitter/build-module/batch.sh b/admin/notes/tree= -sitter/build-module/batch.sh index 1d4076564dc..685a35c269d 100755 --- a/admin/notes/tree-sitter/build-module/batch.sh +++ b/admin/notes/tree-sitter/build-module/batch.sh @@ -15,6 +15,7 @@ languages=3D( 'html' 'javascript' 'json' + 'lua' 'python' 'rust' 'toml' diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree= -sitter/build-module/build.sh index 0832875168b..969187b7f92 100755 --- a/admin/notes/tree-sitter/build-module/build.sh +++ b/admin/notes/tree-sitter/build-module/build.sh @@ -42,6 +42,9 @@ case "${lang}" in "heex") org=3D"phoenixframework" ;; + "lua") + org=3D"MunifTanjim" + ;; "typescript") sourcedir=3D"tree-sitter-typescript/typescript/src" grammardir=3D"tree-sitter-typescript/typescript" diff --git a/etc/NEWS b/etc/NEWS index 9a98db8c83a..1a40a62615b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -730,6 +730,10 @@ A major mode based on the tree-sitter library for editin= g HEEx files. A major mode based on the tree-sitter library for editing Elixir files. =20 +--- +*** New major mode 'lua-ts-mode'. +A major mode based on the tree-sitter library for editing Lua files. + --- ** The highly accessible Modus themes collection has eight items. The 'modus-operandi' and 'modus-vivendi' are the main themes that have diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 65daa0941d5..f249e3c81b4 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -237,7 +237,7 @@ chosen (interactively or automatically)." (gdscript-mode . ("localhost" 6008)) ((fortran-mode f90-mode) . ("fortls")) (futhark-mode . ("futhark" "lsp")) - (lua-mode . ,(eglot-alternatives + ((lua-mode lua-ts-mode) . ,(eglot-alternativ= es '("lua-language-server" "lua-l= sp"))) (zig-mode . ("zls")) ((css-mode css-ts-mode) diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index b878986d7a4..78e39fad740 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -264,6 +264,7 @@ This has effect only if `search-invisible' is set to `ope= n'." (java-ts-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (js-ts-mode "{" "}" "/[*/]" nil) + (lua-ts-mode "{\\|\\[\\[" "}\\|\\]\\]" "--" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "