Skip to content
Merged
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
8 changes: 4 additions & 4 deletions extension.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
id = "objectscript"
name = "InterSystems ObjectScript"
version = "1.3.0"
version = "1.4.0"
schema_version = 1
authors = ["Dave McCaldon <davem@intersystems.com>","Hannah Kimura <hannah.kimura@intersystems.com>"]
description = "InterSystems IRIS ObjectScript Extension"
repository = "https://github.com/intersystems/zed-objectscript"

[grammars.objectscript_udl]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "e492601cb5b4564fdf41e5a1800432a3ee4cf74f"
commit = "8d1c5370c657548d3e843061462e72f8bc1e9e7b"
path = "udl"

[grammars.objectscript_routine]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "e492601cb5b4564fdf41e5a1800432a3ee4cf74f"
commit = "8d1c5370c657548d3e843061462e72f8bc1e9e7b"
path = "objectscript_routine"

[grammars.objectscript]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "e492601cb5b4564fdf41e5a1800432a3ee4cf74f"
commit = "8d1c5370c657548d3e843061462e72f8bc1e9e7b"
path = "objectscript"

[grammars.xml]
Expand Down
209 changes: 127 additions & 82 deletions languages/objectscript/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
; AUTO-GENERATED by scripts/sync_queries.py
; Edit only the LOCAL section in composed files.
; File: highlights.scm
; === BEGIN EXPR ===
(pattern_expression) @string.regex

[
Expand All @@ -18,24 +22,34 @@
(string_literal)
] @string

(string_literal) @string

[
(keyword_pound_pound_super)
(keyword_pound_pound_class)
] @keyword

(system_defined_variable) @variable.special
(system_defined_function) @function.builtin

; this is because . is grouped into system_defined_function
; and I want the dots to be the same color
(class_method_call
"." @function.builtin)

(byref_arg
"." @function.builtin)

(oref_chain_segment
"." @function.builtin)

(sql_field_modifier) @keyword

[
(property_name)
(parameter_name)
(oref_parameter)
(sql_field_identifier)
] @variant

(method_name) @function

[
(routine_name)
(class_name)
Expand All @@ -46,23 +60,24 @@
(macro_constant)
] @constant

(objectscript_identifier) @variable

[
(lvn)
(gvn)
(ssvn)
(objectscript_identifier)
] @variable

(namespace) @namespace
(system_defined_variable)
"$$"
] @variable.special

[
(gvn)
(objectscript_identifier_special)
(instance_variable)
] @variant

(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

; 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 @@ -116,32 +131,59 @@

(bracket) @punctuation.bracket

;; inherits: objectscript_expr
; === END EXPR ===
; === BEGIN CORE ===
(macro_arg) @variant

(macro_value) @constant.builtin

(macro_def) @preproc

[
(keyword_continue)
(keyword_quit)
(keyword_throw)
(keyword_if)
(keyword_elseif)
(keyword_else)
(keyword_oldelse)
(keyword_try)
(keyword_catch)
(keyword_break)
(keyword_return)
"("
")"
] @punctuation.bracket

[
(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)
(tag_end_if)
] @preproc

[
(keyword_as)
(keyword_of)
(keyword_public)
(keyword_private)
(keyword_methodimpl)
(device_keywords)
(close_parameter_option_value)
(keyword_clear)
(keyword_on)
(keyword_off)
(keyword_all)
(keyword_ext)
(keyword_destruct)
(keyword_zbreak)
(keyword_debug)
(zbreak_command_option)
(keyword_trace)
(keyword_step)
(keyword_nostep)
(keyword_stepmethod)
(keyword_errortrap)
(keyword_interrupt)
(keyword_normal)
(keyword_zkill)
(keyword_zn)
(keyword_zsu)
Expand All @@ -153,8 +195,7 @@
(keyword_write)
(keyword_zwrite)
(keyword_do)
(keyword_for)
(keyword_while)
(keyword_do_old)
(keyword_kill)
(keyword_lock)
(keyword_read)
Expand All @@ -173,43 +214,25 @@
(keyword_tstart)
(keyword_xecute)
(keyword_view)
(keyword_zremove)
(command_keyword)
(keyword_zload)
(keyword_for)
(keyword_while)
(keyword_continue)
(keyword_quit)
(keyword_break)
(keyword_return)
(keyword_if)
(keyword_old_if)
(keyword_elseif)
(keyword_else)
(keyword_oldelse)
(keyword_throw)
(keyword_try)
(keyword_catch)
] @type.builtin

[
(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)
] @preproc

"--" @operator

[
(keyword_as)
(keyword_of)
(keyword_public)
(keyword_private)
(keyword_methodimpl)
(device_keywords)
(close_parameter_option_value)
(keyword_clear)
(keyword_on)
(keyword_off)
(keyword_all)
(keyword_ext)
(keyword_stepmethod)
(keyword_destruct)
] @keyword

[
(keyword_embedded_html)
(keyword_embedded_xml)
Expand All @@ -232,26 +255,51 @@
(line_comment_3)
(line_comment_4)
(block_comment)
(inline_comment)
(argumentless_inline_comment)
] @comment

(tag) @label

; case where comments get eaten by scanner, this will still
; highlight just the comments of these commands as comments
[
(command_quit)
(command_else)
(command_continue)
(command_if)
(command_do)
(command_for)
(command_lock)
(command_return)
(command_halt_or_hang)
(command_break)
] @comment
(pound_if_special_case_else)
(pound_if_special_case)
] @comment.inactive

"--" @operator

(command_if_dotted_block
"." @punctuation.special.dots)

(command_for_dotted_block
"." @punctuation.special.dots)

(command_while_dotted_block
"." @punctuation.special.dots)

(command_dowhile_dotted
"." @punctuation.special.dots)

(command_trycatch_dotted
"." @punctuation.special.dots)

(dotted_statement
"." @punctuation.special.dots)

(else_block_dotted
"." @punctuation.special.dots)

(elseif_block_dotted
"." @punctuation.special.dots)

(variable_datatype
"." @function.builtin)

(instance_method_call
"." @function.builtin)

; ------------------ UDL -------------------
; === END CORE ===
; === BEGIN LOCAL ===
(iris_username) @keyword.directive

[
Expand All @@ -272,12 +320,12 @@
(keyword_trigger)
(keyword_xdata)
(keyword_storage)

] @attribute

[
(method_keyword_codemode_expression)
(call_method_keyword)
(extent_index_keyword)
(method_keyword)
(class_keywords)
(query_keywords)
Expand All @@ -288,7 +336,6 @@
(parameter_keyword)
(projection_keyword)
(index_keyword)
(index_keyword_extent)
(xdata_keyword)
(xdata_keyword_mimetype)
(property_keyword)
Expand Down Expand Up @@ -317,16 +364,14 @@
[
(return_type)
(keyword_list)
(keyword_array)
(parameter_type)
(index_type)
(projection_type)
(property_type)
(index_property_type)
(typename)
] @type.builtin

; === END LOCAL ===
; routine
(routine_type) @type.builtin

(routine) @attribute
(routine) @attribute
Loading