From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 02:30:32 2023 Received: (at submit) by debbugs.gnu.org; 1 Sep 2023 06:30:32 +0000 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 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 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 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 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) From: ~johnmuhl Date: Thu, 31 Aug 2023 16:32:06 -0500 Subject: [PATCH emacs 1/1] Add lua-ts-mode Message-ID: <169352253839.28940.16024479871485106701-1@git.sr.ht> X-Mailer: git.sr.ht In-Reply-To: <169352253839.28940.16024479871485106701-0@git.sr.ht> To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 01 Sep 2023 02:30:26 -0400 Cc: ~emacs/emacs-devel@lists.sr.ht X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~johnmuhl Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 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 "{\\|<[^/>]*?" "}\\|]*[^/]>" "