diff --git a/Cargo.lock b/Cargo.lock index b8e4730b8caa..43963f31d38c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5192,6 +5192,7 @@ dependencies = [ "tree-sitter-go", "tree-sitter-java", "tree-sitter-kotlin", + "tree-sitter-lua", "tree-sitter-python", "tree-sitter-ruby", "tree-sitter-rust", @@ -5978,6 +5979,16 @@ dependencies = [ "tree-sitter", ] +[[package]] +name = "tree-sitter-lua" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9fe6fc87bd480e1943fc1fcb02453fb2da050e4e8ce0daa67d801544046856" +dependencies = [ + "cc", + "tree-sitter", +] + [[package]] name = "tree-sitter-python" version = "0.21.0" diff --git a/crates/tabby-common/assets/languages.toml b/crates/tabby-common/assets/languages.toml index 65437a3f566a..5de2658bfb0f 100644 --- a/crates/tabby-common/assets/languages.toml +++ b/crates/tabby-common/assets/languages.toml @@ -274,6 +274,30 @@ exts = ["jl"] [[config]] languages = ["lua"] exts = ["lua"] +line_comment = "--" +top_level_keywords = [ + "and", + "break", + "do", + "else", + "elseif", + "end", + "false", + "for", + "function", + "if", + "in", + "local", + "nil", + "not", + "or", + "repeat", + "return", + "then", + "true", + "until", + "while" +] [[config]] languages = ["makefile"] diff --git a/crates/tabby-scheduler/Cargo.toml b/crates/tabby-scheduler/Cargo.toml index 7e60e859c64b..121c8df07495 100644 --- a/crates/tabby-scheduler/Cargo.toml +++ b/crates/tabby-scheduler/Cargo.toml @@ -23,6 +23,7 @@ tree-sitter-c = { git = "https://github.com/tree-sitter/tree-sitter-c/", rev = " tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "d29fbff" } tree-sitter-c-sharp = "0.21.2" tree-sitter-solidity = { git = "https://github.com/JoranHonig/tree-sitter-solidity", rev = "0e86ae647bda22c9bee00ec59752df7b3d3b000b" } +tree-sitter-lua = "0.1.0" ignore.workspace = true tokio = { workspace = true, features = ["process"] } text-splitter = { version = "0.13.3", features = ["code"] } diff --git a/crates/tabby-scheduler/src/code/languages.rs b/crates/tabby-scheduler/src/code/languages.rs index 4e694c2dcc67..d3e98ffbd04f 100644 --- a/crates/tabby-scheduler/src/code/languages.rs +++ b/crates/tabby-scheduler/src/code/languages.rs @@ -136,6 +136,17 @@ lazy_static! { .unwrap(), ), ), + ( + "lua", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_lua::language(), + tree_sitter_lua::TAGS_QUERY, + "", + ) + .unwrap(), + ), + ), ]) }; } diff --git a/website/docs/programming-languages.md b/website/docs/programming-languages.md index 72cc5fb316b4..09159e63fe18 100644 --- a/website/docs/programming-languages.md +++ b/website/docs/programming-languages.md @@ -35,6 +35,7 @@ For an actual example of an issue or pull request adding the above support, plea * [Solidity](https://soliditylang.org/): Since v0.10.0 * [R](https://www.r-project.org/): Since v0.12.0 * [Dart](https://dart.dev/): Since v0.12.0 +* [Lua](https://www.lua.org): Since 0.14.0 ## Languages Missing Certain Support @@ -43,6 +44,5 @@ For an actual example of an issue or pull request adding the above support, plea | CSS | 🚫 | 🚫 | | Haskell | 🚫 | 🚫 | | Julia | 🚫 | 🚫 | -| Lua | 🚫 | 🚫 | | Perl | 🚫 | 🚫 | | Scala | 🚫 | 🚫 |