Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--book/src/generated/lang-support.md2
-rw-r--r--languages.toml3
-rw-r--r--runtime/queries/robot/highlights.scm4
-rw-r--r--runtime/queries/robot/indents.scm21
4 files changed, 27 insertions, 3 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index a31fca63..db647f2d 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -244,7 +244,7 @@
| rescript | ✓ | ✓ | | | | `rescript-language-server` |
| ripple | ✓ | | | ✓ | ✓ | `ripple-language-server` |
| rmarkdown | ✓ | | ✓ | | | `R` |
-| robot | ✓ | | | | | `robotcode`, `robotframework_ls` |
+| robot | ✓ | | ✓ | | | `robotcode`, `robotframework_ls` |
| robots.txt | ✓ | ✓ | | ✓ | | |
| ron | ✓ | | ✓ | ✓ | ✓ | `ron-lsp` |
| rpmspec | ✓ | | | | | |
diff --git a/languages.toml b/languages.toml
index 4b1bace2..c4fb47bc 100644
--- a/languages.toml
+++ b/languages.toml
@@ -2493,6 +2493,7 @@ source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-ron", rev
[[language]]
name = "robot"
+language-id="robotframework"
scope = "source.robot"
injection-regex = "robot"
file-types = ["robot", "resource"]
@@ -2502,7 +2503,7 @@ language-servers = [ "robotcode", "robotframework_ls" ]
[[grammar]]
name = "robot"
-source = { git = "https://github.com/Hubro/tree-sitter-robot", rev = "322e4cc65754d2b3fdef4f2f8a71e0762e3d13af" }
+source = { git = "https://github.com/Hubro/tree-sitter-robot", rev = "0f010f439e7873db42d3aabae8a48a8f61a89910" }
[[language]]
name = "r"
diff --git a/runtime/queries/robot/highlights.scm b/runtime/queries/robot/highlights.scm
index 06e95798..64d7b68b 100644
--- a/runtime/queries/robot/highlights.scm
+++ b/runtime/queries/robot/highlights.scm
@@ -10,7 +10,9 @@
(test_case_setting)
] @keyword
-(variable_definition (variable_name) @variable)
+(scalar_variable (variable_name) @variable)
+(list_variable (variable_name) @variable)
+(dictionary_variable (variable_name) @variable)
(keyword_definition (name) @function)
(test_case_definition (name) @function)
diff --git a/runtime/queries/robot/indents.scm b/runtime/queries/robot/indents.scm
new file mode 100644
index 00000000..f9610606
--- /dev/null
+++ b/runtime/queries/robot/indents.scm
@@ -0,0 +1,21 @@
+(keyword_definition) @indent
+(test_case_definition) @indent
+
+(for_statement) @indent
+(for_statement "END" @outdent)
+(for_statement
+ right: (_ (arguments (continuation (ellipses) @outdent))))
+
+(while_statement) @indent
+(while_statement "END" @outdent)
+
+(if_statement) @indent
+(if_statement (elseif_statement) @outdent)
+(if_statement (else_statement) @outdent)
+(if_statement "END" @outdent)
+
+(try_statement) @indent
+(try_statement (except_statement) @outdent)
+(try_statement (finally_statement) @outdent)
+(try_statement (else_statement) @outdent)
+(try_statement "END" @outdent)