From: bug-gnu-emacs@gnu.org Date: Mon, 11 Sep 2023 15:03:13 +0000 (-0500) Subject: bug#65673: Add lua-ts-mode X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b6659e98a4fcaa44477b64d7782243feca020418;p=emacs.git bug#65673: Add lua-ts-mode * lisp/progmodes/lua-ts-mode.el: * test/lisp/progmodes/lua-ts-mode-resources/indent.erts: * test/lisp/progmodes/lua-ts-mode-tests.el: New files. * etc/NEWS: Mention the new mode. * lisp/progmodes/eglot.el (eglot-server-programs): * lisp/progmodes/hideshow.el (hs-special-modes-alist): Support 'lua-ts-mode'. * admin/notes/tree-sitter/build-module/batch.sh: * admin/notes/tree-sitter/build-module/build.sh: Add Lua. * test/infra/Dockerfile.emba: * test/infra/test-jobs.yml: Include lua-ts-mode tests. --- diff --git a/admin/notes/tree-sitter/build-module/batch.sh b/admin/notes/tree-sitter/build-module/batch.sh index 3c4e1472c89..9988d1eae4e 100755 --- a/admin/notes/tree-sitter/build-module/batch.sh +++ b/admin/notes/tree-sitter/build-module/batch.sh @@ -16,6 +16,7 @@ languages=( 'java' '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="phoenixframework" ;; + "lua") + org="MunifTanjim" + ;; "typescript") sourcedir="tree-sitter-typescript/typescript/src" grammardir="tree-sitter-typescript/typescript" diff --git a/etc/NEWS b/etc/NEWS index 4e7ad25b484..c618f3dafa6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -812,6 +812,10 @@ It highlights parens via ‘show-paren-mode’ and ‘blink-matching-paren’ in a user-friendly way, avoids reporting alleged paren mismatches and makes sexp navigation more intuitive. +--- +*** 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 d045a135579..79b3dbb2994 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -268,8 +268,8 @@ chosen (interactively or automatically)." (gdscript-mode . ("localhost" 6008)) ((fortran-mode f90-mode) . ("fortls")) (futhark-mode . ("futhark" "lsp")) - (lua-mode . ,(eglot-alternatives - '("lua-language-server" "lua-lsp"))) + ((lua-mode lua-ts-mode) . ,(eglot-alternatives + '("lua-language-server" "lua-lsp"))) (zig-mode . ("zls")) ((css-mode css-ts-mode) . ,(eglot-alternatives '(("vscode-css-language-server" "--stdio") 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 `open'." (java-ts-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (js-ts-mode "{" "}" "/[*/]" nil) + (lua-ts-mode "{\\|\\[\\[" "}\\|\\]\\]" "--" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "