Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extension.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ repository = "https://github.com/intersystems/zed-objectscript"

[grammars.objectscript_udl]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "58432d03bfba25efad3059a52d0916d714739b09"
commit = "e2193fdc37b5c64f3d442873a3d7ed2992c2cecf"
path = "udl"

[grammars.objectscript_routine]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "58432d03bfba25efad3059a52d0916d714739b09"
commit = "e2193fdc37b5c64f3d442873a3d7ed2992c2cecf"
path = "objectscript_routine"

[grammars.objectscript]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "58432d03bfba25efad3059a52d0916d714739b09"
commit = "e2193fdc37b5c64f3d442873a3d7ed2992c2cecf"
path = "objectscript"

[grammars.xml]
Expand Down
42 changes: 27 additions & 15 deletions languages/objectscript/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
[
(keyword_super)
(keyword_pound_pound_class)
] @keyword
(keyword_quote_directive)
(keyword_pound_expression)
] @property

(system_defined_function) @constant.builtin

Expand Down Expand Up @@ -78,6 +80,7 @@
(ssvn)
(system_defined_variable)
"$$"
(keyword_this)
] @variable.special

[
Expand All @@ -86,7 +89,15 @@
] @variant

(method_arg) @variable.parameter

[(line_comment_1)
(line_comment_2)
(line_comment_3)
(line_comment_4)
(block_comment)
(inline_comment)
(argumentless_inline_comment)
] @comment
(documatic_line) @comment.doc
; I didn't include ( or ) in this, because they are often grouped
; as part of a sequence that gets turned into a single token, so they
; don't get matched, and one ends up getting colored differently than the other.
Expand Down Expand Up @@ -139,16 +150,15 @@
"?"
] @operator

; === END EXPR ===
; === BEGIN CORE ===
(macro_arg) @variant

(macro_value) @constant.builtin

(macro_def) @preproc
(macro_def) @property

[
(keyword_pound_define)
(keyword_sqlcompile)
(keyword_pound_def1arg)
(keyword_pound_if)
(keyword_pound_elseif)
Expand All @@ -162,7 +172,8 @@
(keyword_pound_delay)
(locktype)
(tag_end_if)
] @preproc
(pound_execute)
] @property

[
(keyword_as)
Expand Down Expand Up @@ -193,6 +204,7 @@
(keyword_ztrap)
(keyword_zz)
(keyword_print)
(keyword_select)
(keyword_zprint)
(keyword_set)
(keyword_write)
Expand Down Expand Up @@ -234,6 +246,7 @@
(keyword_throw)
(keyword_try)
(keyword_catch)
(keyword_zedit)
] @keyword

[
Expand All @@ -252,6 +265,11 @@
(html_marker_reversed)
] @punctuation.special

[
(pound_if_special_case_else)
(pound_if_special_case)
] @comment

(tag) @function

"--" @operator
Expand Down Expand Up @@ -284,15 +302,15 @@
"." @constant.builtin)

; === END CORE ===
; === BEGIN LOCAL ===
(iris_username) @preproc
(iris_username) @property

[
(keyword_import)
(keyword_include)
(keyword_includegenerator)
(keyword_method)
(keyword_classmethod)
(keyword_clientmethod)
(keyword_extends)
(keyword_property)
(keyword_relationship)
Expand Down Expand Up @@ -329,7 +347,6 @@
(property_keyword)
] @type.builtin


[
(query_name)
(trigger_name)
Expand All @@ -341,19 +358,14 @@
(xdata_name)
(storage_name)
(xml_identifier)
(index_property)
(column_name)
] @variant

[
(return_type)
(keyword_list)
(parameter_type)
(index_type)
(index_property_type)
(typename)
] @type.builtin
; === END UDL ===

; routine
(routine_type) @type.builtin

Expand Down
24 changes: 19 additions & 5 deletions languages/objectscript/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
; Keywords, one of type language = "python", none of type codemode
; External method body injection based on [ Language = ... ]
(method_definition
(python_method_body_content) @injection.content
(method_keyword_external_language
(typename) @_lang)
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#any-of? @_lang "python" "Python" "PYTHON")
(#set! injection.language "python"))

(method_definition
Expand All @@ -48,8 +51,11 @@
(#set! injection.language "ispl"))

(trigger
(python_method_body_content) @injection.content
(method_keyword_external_language
(typename) @_lang)
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#any-of? @_lang "python" "Python" "PYTHON")
(#set! injection.language "python"))

(trigger
Expand Down Expand Up @@ -87,6 +93,14 @@
(#any-of? @_mt "text/markdown" "\"text/markdown\"")
(#set! injection.language "markdown"))

(xdata
(xdata_keyword_mimetype
(typename) @_mt)
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#any-of? @_mt "text/x-python" "\"text/x-python\"" "application/python" "\"application/python\"")
(#set! injection.language "python"))

(xdata
(xdata_keyword_mimetype
(typename) @_mt)
Expand Down Expand Up @@ -141,7 +155,7 @@
(#set! injection.language "xml")
(#set! injection.include-children "true"))

([
([
(line_comment_1)
(line_comment_2)
(line_comment_3)
Expand All @@ -150,7 +164,7 @@
(inline_comment)
(argumentless_inline_comment)
(documatic_line)
] @injection.content
(#set! injection.language "comment"))
] @injection.content
(#set! injection.language "comment"))

; === END LOCAL ===
27 changes: 22 additions & 5 deletions languages/objectscript_routine/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
[
(keyword_super)
(keyword_pound_pound_class)
] @keyword
(keyword_quote_directive)
(keyword_pound_expression)
] @property

(system_defined_function) @constant.builtin

Expand Down Expand Up @@ -55,7 +57,7 @@
[
(routine_name)
(class_name)
] @type
] @enum

[
(macro_function)
Expand All @@ -77,6 +79,7 @@
[
(ssvn)
(system_defined_variable)
(keyword_this)
"$$"
] @variable.special

Expand All @@ -86,6 +89,15 @@
] @variant

(method_arg) @variable.parameter
[(line_comment_1)
(line_comment_2)
(line_comment_3)
(line_comment_4)
(block_comment)
(inline_comment)
(argumentless_inline_comment)
] @comment
(documatic_line) @comment.doc

; I didn't include ( or ) in this, because they are often grouped
; as part of a sequence that gets turned into a single token, so they
Expand Down Expand Up @@ -145,7 +157,7 @@

(macro_value) @constant.builtin

(macro_def) @preproc
(macro_def) @property

[
(keyword_pound_define)
Expand All @@ -157,12 +169,14 @@
(keyword_pound_ifdef)
(keyword_pound_ifndef)
(keyword_dim)
(keyword_sqlcompile)
(keyword_pound_import)
(keyword_pound_include)
(keyword_pound_delay)
(locktype)
(pound_execute)
(tag_end_if)
] @preproc
] @property

[
(keyword_as)
Expand Down Expand Up @@ -195,6 +209,7 @@
(keyword_print)
(keyword_zprint)
(keyword_set)
(keyword_select)
(keyword_write)
(keyword_zwrite)
(keyword_do)
Expand Down Expand Up @@ -234,7 +249,8 @@
(keyword_throw)
(keyword_try)
(keyword_catch)
] @type.builtin
(keyword_zedit)
] @keyword

[
(keyword_embedded_html)
Expand All @@ -258,6 +274,7 @@
] @comment

(tag) @function
(typename) @type.builtin

"--" @operator

Expand Down
Loading