Skip to content

Commit 06d40d7

Browse files
Merge pull request #2 from hkimura-intersys/v1.3.0
feature: add popular themes, and add syntax highlighting for Objectscript within XML files
2 parents 9c6909f + b6c340b commit 06d40d7

17 files changed

Lines changed: 1518 additions & 12 deletions

extension.toml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
id = "objectscript"
22
name = "InterSystems ObjectScript"
3-
version = "1.2.0"
3+
version = "1.3.0"
44
schema_version = 1
55
authors = ["Dave McCaldon <davem@intersystems.com>","Hannah Kimura <hannah.kimura@intersystems.com>"]
66
description = "InterSystems IRIS ObjectScript Extension"
77
repository = "https://github.com/intersystems/zed-objectscript"
88

9-
[grammars.objectscript]
9+
[grammars.objectscript_udl]
1010
repository = "https://github.com/intersystems/tree-sitter-objectscript"
11-
commit = "78f0fdb872bbb65084ee9a0d3ad44093cc913684"
11+
commit = "bd68f926f0b3451421be3b60387d0dce901aebe7"
1212
path = "udl"
1313

1414
[grammars.objectscript_core]
1515
repository = "https://github.com/intersystems/tree-sitter-objectscript"
16-
commit = "78f0fdb872bbb65084ee9a0d3ad44093cc913684"
16+
commit = "bd68f926f0b3451421be3b60387d0dce901aebe7"
1717
path = "core"
18+
19+
[grammars.objectscript]
20+
repository = "https://github.com/intersystems/tree-sitter-objectscript"
21+
commit = "bd68f926f0b3451421be3b60387d0dce901aebe7"
22+
path = "objectscript"
23+
24+
[grammars.xml]
25+
repository = "https://github.com/tree-sitter-grammars/tree-sitter-xml"
26+
commit = "5000ae8f22d11fbe93939b05c1e37cf21117162d"
27+
path = "xml"

languages/objectscript/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name = "objectscript"
22
grammar = "objectscript"
3-
path_suffixes = ["cls"]
43
line_comments = ["// ", ";", ";;", "#;"]
54
autoclose_before = ";:.,=}])>` \n\t\""
65
brackets = [

languages/objectscript/highlights.scm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; EXPR GRAMMAR HIGHLIGHTS
21
(pattern_expression) @string.regex
32
(numeric_literal) @number
43
(string_literal) @string
@@ -85,7 +84,7 @@
8584
(json_null_literal) @string
8685
(bracket) @punctuation.bracket
8786

88-
; CORE GRAMMAR HIGHLIGHTS
87+
;; inherits: objectscript_expr
8988
(locktype) @variable
9089

9190
(macro_arg) @variable
@@ -123,7 +122,9 @@ keyword: (_) @keyword
123122
"$"
124123
] @punctuation
125124

126-
; UDL grammar highlights
125+
;; inherits: objectscript_core
126+
; ------------------ UDL -------------------
127+
127128
[
128129
(method_keyword_codemode_expression)
129130
(call_method_keyword)
@@ -164,4 +165,4 @@ keyword: (_) @keyword
164165
(property_type) @type.builtin
165166
(index_property_type) @type.builtin
166167

167-
(identifier) @variable
168+
(identifier) @variable

languages/objectscript_core/highlights.scm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; EXPR GRAMMAR HIGHLIGHTS
21
(pattern_expression) @string.regex
32
(numeric_literal) @number
43
(string_literal) @string
@@ -85,7 +84,7 @@
8584
(json_null_literal) @string
8685
(bracket) @punctuation.bracket
8786

88-
; CORE GRAMMAR HIGHLIGHTS
87+
;; inherits: objectscript_expr
8988
(locktype) @variable
9089

9190
(macro_arg) @variable
@@ -121,4 +120,5 @@ keyword: (_) @keyword
121120
"#;"
122121
"##;"
123122
"$"
124-
] @punctuation
123+
] @punctuation
124+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name = "ObjectscriptUdl"
2+
grammar = "objectscript_udl"
3+
path_suffixes = ["cls"]
4+
line_comments = ["// ", ";", ";;", "#;"]
5+
autoclose_before = ";:.,=}])>` \n\t\""
6+
brackets = [
7+
{ start = "{", end = "}", close = true, newline = true },
8+
{ start = "[", end = "]", close = true, newline = false },
9+
{ start = "(", end = ")", close = true, newline = false },
10+
]
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
(pattern_expression) @string.regex
2+
(numeric_literal) @number
3+
(string_literal) @string
4+
5+
(keyword_pound_pound_class) @keyword
6+
(keyword_pound_pound_super) @keyword
7+
(system_defined_variable) @variable.special
8+
(system_defined_function) @variable.special
9+
(sql_field_modifier) @variable.special
10+
(property_name) @property
11+
(method_name) @function
12+
(parameter_name) @property
13+
(class_name) @type
14+
(macro) @constant
15+
16+
(routine_ref) @variable
17+
(sql_field_identifier) @variable
18+
(lvn) @variable
19+
(gvn) @variable
20+
(ssvn) @variable
21+
(instance_variable) @variable
22+
(objectscript_identifier) @variable
23+
24+
(method_arg) @variable.parameter
25+
; I didn't include ( or ) in this, because they are often grouped
26+
; as part of a sequence that gets turned into a single token, so they
27+
; don't get matched, and one ends up getting colored differently than the other.
28+
[
29+
"_"
30+
","
31+
":"
32+
"."
33+
".."
34+
"..."
35+
"'["
36+
"']"
37+
"']]"
38+
"\""
39+
"\"\""
40+
"["
41+
"]"
42+
"]]"
43+
"{"
44+
"}"
45+
"/"
46+
"\\"
47+
"#"
48+
"|"
49+
"||"
50+
"/"
51+
"/"
52+
"$$"
53+
] @punctuation
54+
55+
[
56+
"'&"
57+
"&"
58+
"&&"
59+
"'<"
60+
"'="
61+
"'>"
62+
"^"
63+
"-"
64+
"^$"
65+
"+"
66+
"<"
67+
"<="
68+
"="
69+
">"
70+
">="
71+
"@"
72+
"*"
73+
"**"
74+
"'"
75+
"'!"
76+
"'?"
77+
"!"
78+
"?"
79+
] @operator
80+
81+
(json_string_literal) @string
82+
(json_boolean_literal) @boolean
83+
(json_number_literal) @number
84+
(json_null_literal) @string
85+
(bracket) @punctuation.bracket
86+
87+
;; inherits: objectscript_expr
88+
(locktype) @variable
89+
90+
(macro_arg) @variable
91+
(macro_value) @constant.builtin
92+
keyword: (_) @keyword
93+
94+
(embedded_js_special_case_complete) @punctuation.special
95+
(embedded_sql_marker) @punctuation.special
96+
(embedded_sql_reverse_marker) @punctuation.special
97+
(html_marker) @punctuation.special
98+
(html_marker_reversed) @punctuation.special
99+
100+
(attribute) @attribute
101+
102+
(open_keywords) @attribute
103+
(use_keywords) @attribute
104+
(close_parameter_option_value) @attribute
105+
106+
[
107+
(line_comment_1)
108+
(line_comment_2)
109+
(line_comment_3)
110+
(line_comment_4)
111+
(block_comment)
112+
] @comment
113+
114+
(tag) @tag
115+
116+
[
117+
"--"
118+
";"
119+
"//"
120+
"#;"
121+
"##;"
122+
"$"
123+
] @punctuation
124+
125+
;; inherits: objectscript_core
126+
; ------------------ UDL -------------------
127+
128+
[
129+
(method_keyword_codemode_expression)
130+
(call_method_keyword)
131+
(method_keyword)
132+
(class_keywords)
133+
(query_keywords)
134+
(trigger_keyword)
135+
(method_keyword_language)
136+
(relationship_keyword)
137+
(foreignkey_keyword)
138+
(parameter_keyword)
139+
(projection_keyword)
140+
(index_keyword)
141+
(index_keyword_extent)
142+
(xdata_keyword)
143+
(xdata_keyword_mimetype)
144+
(property_keyword)
145+
146+
] @attribute
147+
148+
(documatic_line) @comment.doc
149+
150+
(query_name) @property
151+
(property_name) @property
152+
(relationship_name) @property
153+
(foreignkey_name) @property
154+
(parameter_name) @property
155+
(projection_name) @property
156+
(index_name) @property
157+
(xdata_name) @property
158+
(storage_name) @property
159+
160+
(return_type) @type.builtin
161+
(typename) @type
162+
(parameter_type) @type.builtin
163+
(index_type) @type.builtin
164+
(projection_type) @type.builtin
165+
(property_type) @type.builtin
166+
(index_property_type) @type.builtin
167+
168+
(identifier) @variable
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
("{" @indents.begin)
2+
("}" @indents.end)
3+
4+
5+

0 commit comments

Comments
 (0)