feat: add objectscript routine recognition as well

This commit is contained in:
Hannah 2026-03-24 16:27:44 -04:00
parent 6f2be999f2
commit c97ffd4511
No known key found for this signature in database
GPG key ID: 0C1C205F4C354DE1
7 changed files with 494 additions and 110 deletions

View file

@ -195,6 +195,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka
[nu](https://github.com/nushell/tree-sitter-nu) | unstable | `HFIJ ` | @abhisheksingh0x558
[objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | unstable | `HFIJL` | @amaanq
[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | unstable | `H  J ` | @ColinKennedy
[objectscript_routine](https://github.com/intersystems/tree-sitter-objectscript) | unstable | `H IJ ` | @davem-intersys, @hkimura-intersys
[objectscript_udl](https://github.com/intersystems/tree-sitter-objectscript) | unstable | `H IJ ` | @davem-intersys, @hkimura-intersys
[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu

View file

@ -1498,10 +1498,19 @@ return {
maintainers = { '@ColinKennedy' },
tier = 2,
},
objectscript_routine = {
install_info = {
location = 'objectscript_routine',
revision = 'a60196ecc4e6d492510a0eb0374e74020895b917',
url = 'https://github.com/intersystems/tree-sitter-objectscript',
},
maintainers = { '@davem-intersys', '@hkimura-intersys' },
tier = 2,
},
objectscript_udl = {
install_info = {
location = 'udl',
revision = '7aa01969d0fea2e75dc69f2be2244b13d8269d6f',
revision = 'a60196ecc4e6d492510a0eb0374e74020895b917',
url = 'https://github.com/intersystems/tree-sitter-objectscript',
},
maintainers = { '@davem-intersys', '@hkimura-intersys' },

View file

@ -0,0 +1,284 @@
; AUTO-GENERATED by scripts/sync_queries.py
; Edit only the LOCAL section in composed files.
; File: highlights.scm
; === BEGIN EXPR ===
(pattern_expression) @string.regexp
[
(json_number_literal)
(numeric_literal)
] @number
[
(json_boolean_literal)
(json_null_literal)
] @boolean
(json_object_literal_pair
(json_string_literal) @string.special)
[
(json_string_literal)
(string_literal)
] @string
[
(keyword_pound_pound_super)
(keyword_pound_pound_class)
] @keyword.operator
(system_defined_variable) @variable.builtin
(system_defined_function) @function.builtin
(sql_field_modifier) @keyword.modifier
[
(property_name)
(parameter_name)
(sql_field_identifier)
] @variable.member
(method_name) @function.method
[
(routine_name)
(class_name)
] @type
(macro_function) @function.macro
(macro_constant) @constant.macro
[
(lvn)
(gvn)
(ssvn)
(objectscript_identifier)
] @variable
(namespace) @module
[
(objectscript_identifier_special)
(instance_variable)
] @variable.member
(method_arg) @variable.parameter
; 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.
[
"_"
","
":"
".."
"..."
"'["
"']"
"']]"
"\""
"\"\""
"["
"]"
"]]"
"{"
"}"
"/"
"\\"
"#"
"|"
"||"
"$$"
] @punctuation.delimiter
[
"'&"
"&"
"&&"
"'<"
"'="
"'>"
"^"
"-"
"^$"
"+"
"<"
"<="
"="
">"
">="
"@"
"*"
"**"
"'"
"'!"
"'?"
"!"
"?"
] @operator
(bracket) @punctuation.bracket
; === END EXPR ===
; === BEGIN CORE ===
(macro_arg) @variable.member
(macro_value) @constant.builtin
(macro_def) @keyword.directive.define
[
(keyword_for)
(keyword_while)
(keyword_continue)
(keyword_quit)
] @keyword.repeat
[
(keyword_if)
(keyword_elseif)
(keyword_else)
(keyword_oldelse)
] @keyword.conditional
[
(keyword_throw)
(keyword_try)
(keyword_catch)
] @keyword.exception
(keyword_return) @keyword.return
[
(keyword_break)
(keyword_zbreak)
(keyword_debug)
(keyword_trace)
(keyword_step)
(keyword_nostep)
(keyword_stepmethod)
(keyword_errortrap)
(keyword_interrupt)
(keyword_normal)
(keyword_zkill)
(keyword_zn)
(keyword_zsu)
(keyword_ztrap)
(keyword_zz)
] @keyword.debug
[
(keyword_pound_define)
(keyword_pound_def1arg)
(keyword_pound_if)
(keyword_pound_elseif)
(keyword_pound_else)
(keyword_pound_endif)
(keyword_pound_ifdef)
(keyword_pound_ifndef)
(keyword_dim)
(keyword_pound_import)
(keyword_pound_include)
(keyword_pound_delay)
(locktype)
] @keyword.directive
[
(keyword_as)
(keyword_of)
(keyword_public)
(keyword_private)
(keyword_methodimpl)
(open_keywords)
(use_keywords)
(close_parameter_option_value)
(keyword_clear)
(keyword_on)
(keyword_off)
(keyword_all)
(keyword_ext)
(keyword_stepmethod)
(keyword_destruct)
] @keyword.modifier
[
(keyword_print)
(keyword_zprint)
(keyword_set)
(keyword_write)
(keyword_zwrite)
(keyword_do)
(keyword_for)
(keyword_while)
(keyword_kill)
(keyword_lock)
(keyword_read)
(keyword_open)
(keyword_close)
(keyword_use)
(keyword_new)
(keyword_job)
(keyword_merge)
(keyword_goto)
(keyword_halt_or_hang)
(keyword_halt)
(keyword_hang)
(keyword_tcommit)
(keyword_trollback)
(keyword_tstart)
(keyword_xecute)
(keyword_view)
] @function.builtin
[
(keyword_embedded_html)
(keyword_embedded_xml)
(keyword_embedded_sql_amp)
(keyword_embedded_sql_hash)
(keyword_js)
] @keyword.operator
[
(embedded_js_special_case_complete)
(embedded_sql_marker)
(embedded_sql_reverse_marker)
(html_marker)
(html_marker_reversed)
] @punctuation.special
[
(line_comment_1)
(line_comment_2)
(line_comment_3)
(line_comment_4)
(block_comment)
] @comment @spell
(namespace) @module
(tag) @label
[
(command_quit)
(command_else)
(command_continue)
(command_if)
(command_do)
(command_for)
(command_lock)
(command_return)
(command_halt_or_hang)
(command_break)
] @comment
; === END CORE ===
; === BEGIN LOCAL ===
(routine_type) @type.builtin
(documatic_line) @comment.documentation @spell
(routine) @keyword.type
; === END LOCAL ===

View file

@ -0,0 +1,3 @@
"{" @indent.begin
"}" @indent.end

View file

@ -0,0 +1,27 @@
(embedded_html
(angled_bracket_fenced_text) @injection.content
(#set! injection.language "html"))
(embedded_sql
(_
(paren_fenced_text) @injection.content)
(#set! injection.language "sql"))
(embedded_js
[
(angled_bracket_fenced_text)
(embedded_js_special_case)
] @injection.content
(#set! injection.language "javascript"))
(embedded_xml
(angled_bracket_fenced_text) @injection.content
(#set! injection.language "xml"))
([
(line_comment_1)
(line_comment_2)
(line_comment_3)
(block_comment)
] @injection.content
(#set! injection.language "comment"))

View file

@ -1,12 +1,27 @@
(pattern_expression) @string.regexp
(numeric_literal) @number
[
(json_number_literal)
(numeric_literal)
] @number
(string_literal) @string
[
(json_boolean_literal)
(json_null_literal)
] @boolean
(keyword_pound_pound_class) @keyword
(json_object_literal_pair
(json_string_literal) @string.special)
(keyword_pound_pound_super) @keyword
[
(json_string_literal)
(string_literal)
] @string
[
(keyword_pound_pound_super)
(keyword_pound_pound_class)
] @keyword.operator
(system_defined_variable) @variable.builtin
@ -14,29 +29,36 @@
(sql_field_modifier) @keyword.modifier
(property_name) @property
[
(property_name)
(parameter_name)
(sql_field_identifier)
] @variable.member
(method_name) @function
(method_name) @function.method
(parameter_name) @property
[
(routine_name)
(class_name)
] @type
(class_name) @type
(macro_function) @function.macro
(macro) @constant
(macro_constant) @constant.macro
(routine_ref) @variable
[
(lvn)
(gvn)
(ssvn)
(objectscript_identifier)
] @variable
(sql_field_identifier) @variable
(namespace) @module
(lvn) @variable
(gvn) @variable
(ssvn) @variable
(instance_variable) @variable
(objectscript_identifier) @variable
[
(objectscript_identifier_special)
(instance_variable)
] @variable.member
(method_arg) @variable.parameter
@ -93,26 +115,19 @@
"?"
] @operator
(json_string_literal) @string
(json_boolean_literal) @boolean
(json_number_literal) @number
(json_null_literal) @string
(bracket) @punctuation.bracket
(locktype) @variable
(macro_arg) @variable
(macro_arg) @variable.member
(macro_value) @constant.builtin
(macro_def) @keyword.directive.define
[
(keyword_for)
(keyword_while)
(keyword_continue)
(keyword_quit)
] @keyword.repeat
[
@ -128,18 +143,24 @@
(keyword_catch)
] @keyword.exception
[
(keyword_return)
(keyword_quit)
] @keyword.return
(keyword_return) @keyword.return
[
(keyword_break)
(keyword_zbreak)
(keyword_debug)
(keyword_trace)
(keyword_step)
(keyword_nostep)
(keyword_stepmethod)
(keyword_errortrap)
(keyword_interrupt)
(keyword_normal)
(keyword_zkill)
(keyword_zn)
(keyword_zsu)
(keyword_ztrap)
(keyword_zz)
] @keyword.debug
[
@ -152,12 +173,11 @@
(keyword_pound_ifdef)
(keyword_pound_ifndef)
(keyword_dim)
] @keyword.directive
[
(keyword_pound_import)
(keyword_pound_include)
] @keyword.import
(keyword_pound_delay)
(locktype)
] @keyword.directive
[
(keyword_as)
@ -165,27 +185,62 @@
(keyword_public)
(keyword_private)
(keyword_methodimpl)
(open_keywords)
(use_keywords)
(close_parameter_option_value)
(keyword_clear)
(keyword_on)
(keyword_off)
(keyword_all)
(keyword_ext)
(keyword_stepmethod)
(keyword_destruct)
] @keyword.modifier
keyword: (_) @keyword
[
(keyword_print)
(keyword_zprint)
(keyword_set)
(keyword_write)
(keyword_zwrite)
(keyword_do)
(keyword_for)
(keyword_while)
(keyword_kill)
(keyword_lock)
(keyword_read)
(keyword_open)
(keyword_close)
(keyword_use)
(keyword_new)
(keyword_job)
(keyword_merge)
(keyword_goto)
(keyword_halt_or_hang)
(keyword_halt)
(keyword_hang)
(keyword_tcommit)
(keyword_trollback)
(keyword_tstart)
(keyword_xecute)
(keyword_view)
] @function.builtin
(embedded_js_special_case_complete) @punctuation.special
[
(keyword_embedded_html)
(keyword_embedded_xml)
(keyword_embedded_sql_amp)
(keyword_embedded_sql_hash)
(keyword_js)
] @keyword.operator
(embedded_sql_marker) @punctuation.special
(embedded_sql_reverse_marker) @punctuation.special
(html_marker) @punctuation.special
(html_marker_reversed) @punctuation.special
(attribute) @attribute
(open_keywords) @keyword.modifier
(use_keywords) @keyword.modifier
(close_parameter_option_value) @keyword.modifier
[
(embedded_js_special_case_complete)
(embedded_sql_marker)
(embedded_sql_reverse_marker)
(html_marker)
(html_marker_reversed)
] @punctuation.special
[
(line_comment_1)
@ -195,7 +250,24 @@ keyword: (_) @keyword
(block_comment)
] @comment @spell
(tag) @tag
(namespace) @module
(tag) @label
[
(command_quit)
(command_else)
(command_continue)
(command_if)
(command_do)
(command_for)
(command_lock)
(command_return)
(command_halt_or_hang)
(command_break)
] @comment
(iris_username) @keyword.directive
[
(keyword_import)
@ -223,14 +295,6 @@ keyword: (_) @keyword
(keyword_storage)
] @keyword.type
[
(keyword_as)
(keyword_of)
(keyword_on)
(keyword_not)
(keyword_references)
] @keyword.modifier
[
(method_keyword_codemode_expression)
(call_method_keyword)
@ -248,40 +312,36 @@ keyword: (_) @keyword
(xdata_keyword)
(xdata_keyword_mimetype)
(property_keyword)
(keyword_not)
(keyword_references)
(keyword_byref)
(keyword_output)
] @keyword.modifier
(documatic_line) @comment.documentation
(documatic_line) @comment.documentation @spell
(query_name) @property
[
(query_name)
(trigger_name)
(relationship_name)
(foreignkey_name)
(parameter_name)
(projection_name)
(index_name)
(xdata_name)
(storage_name)
(xml_identifier)
(index_property)
] @variable.member
(property_name) @property
(relationship_name) @property
(foreignkey_name) @property
(parameter_name) @property
(projection_name) @property
(index_name) @property
(xdata_name) @property
(storage_name) @property
(return_type) @type.builtin
(typename) @type
(parameter_type) @type.builtin
(index_type) @type.builtin
(projection_type) @type.builtin
(property_type) @type.builtin
(index_property_type) @type.builtin
(identifier) @variable
[
(return_type)
(keyword_list)
(keyword_array)
(parameter_type)
(index_type)
(projection_type)
(property_type)
(index_property_type)
(typename)
] @type.builtin

View file

@ -29,7 +29,7 @@
(method_definition
(external_method_keywords
(method_keyword_language
(rhs) @_lang))
(typename) @_lang))
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#any-of? @_lang "python" "Python" "PYTHON")
@ -38,7 +38,7 @@
(method_definition
(external_method_keywords
(method_keyword_language
(rhs) @_lang))
(typename) @_lang))
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#any-of? @_lang "tsql" "TSQL" "tSQL" "tSql" "TSql")
@ -47,7 +47,7 @@
(method_definition
(external_method_keywords
(method_keyword_language
(rhs) @_lang))
(typename) @_lang))
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#any-of? @_lang "ispl" "ISPL" "ISpl" "iSpl")
@ -57,7 +57,7 @@
(external_trigger
(trigger_keywords
(method_keyword_language
(rhs) @_lang))
(typename) @_lang))
(external_method_body_content) @injection.content))
(#set! injection.include-children "true")
(#any-of? @_lang "python" "Python" "PYTHON")
@ -67,7 +67,7 @@
(external_trigger
(trigger_keywords
(method_keyword_language
(rhs) @_lang))
(typename) @_lang))
(external_method_body_content) @injection.content))
(#set! injection.include-children "true")
(#any-of? @_lang "tsql" "TSQL" "tSQL" "tSql" "TSql")
@ -87,7 +87,7 @@
(xdata_any
(xdata_keywords
(xdata_keyword_mimetype
(rhs) @_mt))
(typename) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#any-of? @_mt "text/markdown" "\"text/markdown\"")
@ -97,7 +97,7 @@
(xdata_any
(xdata_keywords
(xdata_keyword_mimetype
(rhs) @_mt))
(typename) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#any-of? @_mt "text/xml" "\"text/xml\"" "application/xml" "\"application/xml\"")
@ -107,7 +107,7 @@
(xdata_any
(xdata_keywords
(xdata_keyword_mimetype
(rhs) @_mt))
(typename) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#any-of? @_mt "text/html" "\"text/html\"")
@ -117,7 +117,7 @@
(xdata_any
(xdata_keywords
(xdata_keyword_mimetype
(rhs) @_mt))
(typename) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#any-of? @_mt "application/json" "\"application/json\"")
@ -127,7 +127,7 @@
(xdata_any
(xdata_keywords
(xdata_keyword_mimetype
(rhs) @_mt))
(typename) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#any-of? @_mt "text/yaml" "\"text/yaml\"" "application/yaml" "\"application/yaml\"")
@ -137,7 +137,7 @@
(xdata_any
(xdata_keywords
(xdata_keyword_mimetype
(rhs) @_mt))
(typename) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#any-of? @_mt "text/css" "\"text/css\"")