From 92185e16860a355a7e8a91789c4aa1d3ae49ae5a Mon Sep 17 00:00:00 2001 From: Hannah Date: Fri, 13 Feb 2026 21:44:00 -0500 Subject: [PATCH] chore: bump version to 1.2.0 --- extension.toml | 11 +- .../config.toml | 0 languages/objectscript/highlights.scm | 167 +++++++++++++++ languages/objectscript/indents.scm | 5 + languages/objectscript/injections.scm | 192 +++++++++++++++++ languages/objectscript_core/config.toml | 10 + languages/objectscript_core/highlights.scm | 124 +++++++++++ languages/objectscript_core/indents.scm | 5 + languages/objectscript_core/injections.scm | 33 +++ languages/objectscript_udl/highlights.scm | 196 ------------------ languages/objectscript_udl/indents.scm | 38 ---- languages/objectscript_udl/injections.scm | 140 ------------- languages/objectscript_udl/locals.scm | 0 13 files changed, 544 insertions(+), 377 deletions(-) rename languages/{objectscript_udl => objectscript}/config.toml (100%) create mode 100644 languages/objectscript/highlights.scm create mode 100644 languages/objectscript/indents.scm create mode 100644 languages/objectscript/injections.scm create mode 100644 languages/objectscript_core/config.toml create mode 100644 languages/objectscript_core/highlights.scm create mode 100644 languages/objectscript_core/indents.scm create mode 100644 languages/objectscript_core/injections.scm delete mode 100644 languages/objectscript_udl/highlights.scm delete mode 100644 languages/objectscript_udl/indents.scm delete mode 100644 languages/objectscript_udl/injections.scm delete mode 100644 languages/objectscript_udl/locals.scm diff --git a/extension.toml b/extension.toml index 6e1aa60..f85ab91 100644 --- a/extension.toml +++ b/extension.toml @@ -1,12 +1,17 @@ id = "objectscript" name = "InterSystems ObjectScript" -version = "1.1.0" +version = "1.2.0" schema_version = 1 -authors = ["Dave McCaldon "] +authors = ["Dave McCaldon ","Hannah Kimura "] description = "InterSystems IRIS ObjectScript Extension" repository = "https://github.com/intersystems/zed-objectscript" [grammars.objectscript] repository = "https://github.com/intersystems/tree-sitter-objectscript" -commit = "c0f4461e18d0ac9f4625cddebfeb34ef13f99f8a" +commit = "78f0fdb872bbb65084ee9a0d3ad44093cc913684" path = "udl" + +[grammars.objectscript_core] +repository = "https://github.com/intersystems/tree-sitter-objectscript" +commit = "78f0fdb872bbb65084ee9a0d3ad44093cc913684" +path = "core" diff --git a/languages/objectscript_udl/config.toml b/languages/objectscript/config.toml similarity index 100% rename from languages/objectscript_udl/config.toml rename to languages/objectscript/config.toml diff --git a/languages/objectscript/highlights.scm b/languages/objectscript/highlights.scm new file mode 100644 index 0000000..894ed16 --- /dev/null +++ b/languages/objectscript/highlights.scm @@ -0,0 +1,167 @@ +; EXPR GRAMMAR HIGHLIGHTS +(pattern_expression) @string.regex +(numeric_literal) @number +(string_literal) @string + +(keyword_pound_pound_class) @keyword +(keyword_pound_pound_super) @keyword +(system_defined_variable) @variable.special +(system_defined_function) @variable.special +(sql_field_modifier) @variable.special +(property_name) @property +(method_name) @function +(parameter_name) @property +(class_name) @type +(macro) @constant + +(routine_ref) @variable +(sql_field_identifier) @variable +(lvn) @variable +(gvn) @variable +(ssvn) @variable +(instance_variable) @variable +(objectscript_identifier) @variable + +(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 + +[ + "'&" + "&" + "&&" + "'<" + "'=" + "'>" + "^" + "-" + "^$" + "+" + "<" + "<=" + "=" + ">" + ">=" + "@" + "*" + "**" + "'" + "'!" + "'?" + "!" + "?" +] @operator + +(json_string_literal) @string +(json_boolean_literal) @boolean +(json_number_literal) @number +(json_null_literal) @string +(bracket) @punctuation.bracket + +; CORE GRAMMAR HIGHLIGHTS +(locktype) @variable + +(macro_arg) @variable +(macro_value) @constant.builtin +keyword: (_) @keyword + +(embedded_js_special_case_complete) @punctuation.special +(embedded_sql_marker) @punctuation.special +(embedded_sql_reverse_marker) @punctuation.special +(html_marker) @punctuation.special +(html_marker_reversed) @punctuation.special + +(attribute) @attribute + +(open_keywords) @attribute +(use_keywords) @attribute +(close_parameter_option_value) @attribute + +[ + (line_comment_1) + (line_comment_2) + (line_comment_3) + (line_comment_4) + (block_comment) +] @comment + +(tag) @tag + +[ + "--" + ";" + "//" + "#;" + "##;" + "$" +] @punctuation + +; UDL grammar highlights +[ + (method_keyword_codemode_expression) + (call_method_keyword) + (method_keyword) + (class_keywords) + (query_keywords) + (trigger_keyword) + (method_keyword_language) + (relationship_keyword) + (foreignkey_keyword) + (parameter_keyword) + (projection_keyword) + (index_keyword) + (index_keyword_extent) + (xdata_keyword) + (xdata_keyword_mimetype) + (property_keyword) + +] @attribute + +(documatic_line) @comment.doc + +(query_name) @property +(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 diff --git a/languages/objectscript/indents.scm b/languages/objectscript/indents.scm new file mode 100644 index 0000000..be96f5e --- /dev/null +++ b/languages/objectscript/indents.scm @@ -0,0 +1,5 @@ +("{" @indents.begin) +("}" @indents.end) + + + diff --git a/languages/objectscript/injections.scm b/languages/objectscript/injections.scm new file mode 100644 index 0000000..e14e5a0 --- /dev/null +++ b/languages/objectscript/injections.scm @@ -0,0 +1,192 @@ +; Core grammar injections +(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")) + + + +; UDL injections +;; Keywords, one of type language = "python", none of type codemode +; External method body injection based on [ Language = ... ] +(method_definition + (external_method_keywords + (method_keyword_language + (rhs) @lang)) + (external_method_body_content) @injection.content + (#set! injection.include-children "true") + (#match? @lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$") + (#set! injection.language "python")) + +(method_definition + (external_method_keywords + (method_keyword_language + (rhs) @lang)) + (external_method_body_content) @injection.content + (#set! injection.include-children "true") + (#match? @lang "^[Tt][Ss][Qq][Ll]$") + (#set! injection.language "tsql")) + +(method_definition + (external_method_keywords + (method_keyword_language + (rhs) @lang)) + (external_method_body_content) @injection.content + (#set! injection.include-children "true") + (#match? @lang "^[Ii][Ss][Pp][Ll]$") + (#set! injection.language "ispl")) + + + +;; External trigger with python body +( + (trigger + (external_trigger + (trigger_keywords + (method_keyword_language + (rhs) @lang)) + (external_method_body_content) @injection.content)) + (#set! injection.include-children "true") + (#match? @lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$") + (#set! injection.language "python") +) + +;; External trigger with TSQL body +( + (trigger + (external_trigger + (trigger_keywords + (method_keyword_language + (rhs) @lang)) + (external_method_body_content) @injection.content)) + (#set! injection.include-children "true") + (#match? @lang "^[Tt][Ss][Qq][Ll]$") + (#set! injection.language "tsql") +) + +; A query must be of type %SQLQuery to have an SQL body, otherwise the body +; is empty +(query + (return_type + (typename + (identifier) @_querytype + (#match? @_querytype "^%[Ss][Qq][Ll][Qq][Uu][Ee][Rr][Yy]$"))) + (query_body + (query_body_content) @injection.content) + (#set! injection.language "sql") + (#set! injection.include-children "true") +) + +; XDATA blocks: +; - xdata_any requires a keyword list that includes MimeType +; - xdata_xml allows an optional keyword list and defaults to XML + +; ---------------------------- +; XDATA injections (MimeType) +; ---------------------------- + +; text/markdown +(xdata + (xdata_any + (xdata_keywords + (xdata_keyword_mimetype (rhs) @mt)) + (external_method_body_content) @injection.content) + (#set! injection.include-children "true") + (#match? @mt "^\"?text/markdown\"?$") + (#set! injection.language "markdown")) + +; XML MimeTypes +(xdata + (xdata_any + (xdata_keywords + (xdata_keyword_mimetype (rhs) @mt)) + (external_method_body_content) @injection.content) + (#set! injection.include-children "true") + (#match? @mt "^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Xx][Mm][Ll]\"?$") + (#set! injection.language "xml")) + +; text/html +(xdata + (xdata_any + (xdata_keywords + (xdata_keyword_mimetype (rhs) @mt)) + (external_method_body_content) @injection.content) + (#set! injection.include-children "true") + (#match? @mt "^\"?text/html\"?$") + (#set! injection.language "html")) + +; application/json +(xdata + (xdata_any + (xdata_keywords + (xdata_keyword_mimetype (rhs) @mt)) + (external_method_body_content) @injection.content) + (#set! injection.include-children "true") + (#match? @mt "^\"?application/json\"?$") + (#set! injection.language "json")) + +; text/yaml or application/yaml +(xdata + (xdata_any + (xdata_keywords + (xdata_keyword_mimetype (rhs) @mt)) + (external_method_body_content) @injection.content) + (#set! injection.include-children "true") + (#match? @mt "^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Yy][Aa][Mm][Ll]\"?$") + (#set! injection.language "yaml")) + +; text/css +(xdata + (xdata_any + (xdata_keywords + (xdata_keyword_mimetype (rhs) @mt)) + (external_method_body_content) @injection.content) + (#set! injection.include-children "true") + (#match? @mt "^\"?text/css\"?$") + (#set! injection.language "css")) + +; ----------------------------------------- +; XDATA default (no MimeType): XML fallback +; ----------------------------------------- +(xdata + (xdata_xml + (xdata_keywords)? + (external_method_body_content) @injection.content) + (#set! injection.include-children "true") + (#set! injection.language "xml")) + + +; Storage definition is XML +(storage + (storage_body + (external_method_body_content) @injection.content) + (#set! injection.language "xml") + (#set! injection.include-children "true")) diff --git a/languages/objectscript_core/config.toml b/languages/objectscript_core/config.toml new file mode 100644 index 0000000..76632a6 --- /dev/null +++ b/languages/objectscript_core/config.toml @@ -0,0 +1,10 @@ +name = "objectscript_core" +grammar = "objectscript_core" +path_suffixes = ["inc", "mac"] +line_comments = ["// ", ";", ";;", "#;"] +autoclose_before = ";:.,=}])>` \n\t\"" +brackets = [ + { start = "{", end = "}", close = true, newline = true }, + { start = "[", end = "]", close = true, newline = false }, + { start = "(", end = ")", close = true, newline = false }, +] diff --git a/languages/objectscript_core/highlights.scm b/languages/objectscript_core/highlights.scm new file mode 100644 index 0000000..4ce1c5b --- /dev/null +++ b/languages/objectscript_core/highlights.scm @@ -0,0 +1,124 @@ +; EXPR GRAMMAR HIGHLIGHTS +(pattern_expression) @string.regex +(numeric_literal) @number +(string_literal) @string + +(keyword_pound_pound_class) @keyword +(keyword_pound_pound_super) @keyword +(system_defined_variable) @variable.special +(system_defined_function) @variable.special +(sql_field_modifier) @variable.special +(property_name) @property +(method_name) @function +(parameter_name) @property +(class_name) @type +(macro) @constant + +(routine_ref) @variable +(sql_field_identifier) @variable +(lvn) @variable +(gvn) @variable +(ssvn) @variable +(instance_variable) @variable +(objectscript_identifier) @variable + +(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 + +[ + "'&" + "&" + "&&" + "'<" + "'=" + "'>" + "^" + "-" + "^$" + "+" + "<" + "<=" + "=" + ">" + ">=" + "@" + "*" + "**" + "'" + "'!" + "'?" + "!" + "?" +] @operator + +(json_string_literal) @string +(json_boolean_literal) @boolean +(json_number_literal) @number +(json_null_literal) @string +(bracket) @punctuation.bracket + +; CORE GRAMMAR HIGHLIGHTS +(locktype) @variable + +(macro_arg) @variable +(macro_value) @constant.builtin +keyword: (_) @keyword + +(embedded_js_special_case_complete) @punctuation.special +(embedded_sql_marker) @punctuation.special +(embedded_sql_reverse_marker) @punctuation.special +(html_marker) @punctuation.special +(html_marker_reversed) @punctuation.special + +(attribute) @attribute + +(open_keywords) @attribute +(use_keywords) @attribute +(close_parameter_option_value) @attribute + +[ + (line_comment_1) + (line_comment_2) + (line_comment_3) + (line_comment_4) + (block_comment) +] @comment + +(tag) @tag + +[ + "--" + ";" + "//" + "#;" + "##;" + "$" +] @punctuation \ No newline at end of file diff --git a/languages/objectscript_core/indents.scm b/languages/objectscript_core/indents.scm new file mode 100644 index 0000000..be96f5e --- /dev/null +++ b/languages/objectscript_core/indents.scm @@ -0,0 +1,5 @@ +("{" @indents.begin) +("}" @indents.end) + + + diff --git a/languages/objectscript_core/injections.scm b/languages/objectscript_core/injections.scm new file mode 100644 index 0000000..5262468 --- /dev/null +++ b/languages/objectscript_core/injections.scm @@ -0,0 +1,33 @@ +(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")) + diff --git a/languages/objectscript_udl/highlights.scm b/languages/objectscript_udl/highlights.scm deleted file mode 100644 index 4beaf4d..0000000 --- a/languages/objectscript_udl/highlights.scm +++ /dev/null @@ -1,196 +0,0 @@ -; -------------- Objectscript ------------- - - -; Variables -; ^| e.g. '^||ppg', 'do', 'D' -; ----------------------------------------- -(gvn) @variable.special -(ssvn) @variable.special -(lvn) @variable -(instance_variable) @variable.special - -; String literals -; e.g. "Fo345349*_)(*_)8023841-40"" " -; ----------------------------------------- -(string_literal) @string -(pattern_expression) @string.regex - -; Operators -(_ operator: _ @operator) - -; Numeric literals -; e.g. 12345 -(numeric_literal) @number - -; System variable name -; e.g. $IO, $SY[SYTEM] -(system_defined_variable) @function.builtin - -; System defined functions -; e.g. $ASCII(62) -(system_defined_function) @function.builtin - -(dollarsf - ; $SYSTEM.Foo.Bar() - (dollar_system_keyword) @function.builtin -) - -(property_name) @property -(parameter_name) @constant -(_ parameter: _ @variable.parameter) - -; Method invcoations -(instance_method_call) @function.method.call -(class_method_call - (class_ref (class_name) @type.definition) - (method_name) @function.method.call -) -(oref_method (method_name) @function.method.call) - -(_ preproc_keyword: (_) @keyword.directive) -(_ modifier: (_) @keyword.directive) - - -; User-defined functions -(extrinsic_function) @function.call - -; Goto labels and locations -(_ label: (_) @label) -(_ offset: (_) @number) -(_ routine: (_) @namespace) - -; JSON literals -(json_boolean_literal) @boolean -(json_null_literal) @constant.builtin -(json_number_literal) @number -(json_string_literal) @string.escape - -; Macros -(macro (macro_constant)) @constant.macro -(macro (macro_function)) @function.macro - - -; -------------- Objectscript Core ------------- -; Commands -; e.g. 'set', 'do', 'D' -; ----------------------------------------- -(_ command_name: (_) @keyword) - -(_ macro_name: (_) @keyword.macro) -(_ macro_arg: (_) @constant.macro) -(_ mnemonic: (_) @constant.macro) - -; Functions that can be on the LHS of a SET -(doable_dollar_functions) @function.builtin - -; non-extrinsic routine call -(routine_tag_call) @function.call - -;; Technically elseif and else_block are not statements, -;; so we need ot query them explicitly -;(elseif_block command_name: (_) @keyword) -;(else_block command_name: (_) @keyword) - -"{" @punctuation.bracket -"}" @punctuation.bracket - -; Comments -; e.g. '// fj;lkasdfj', '#; sklfjas;k', '; sklfjas','/* sdfs */' -[ - (line_comment_1) - (line_comment_2) - (line_comment_3) - (block_comment) -] @comment - -(embedded_html - (keyword_embedded_html) @keyword.directive - "<" @keyword.directive - ">" @keyword.directive -) -; (embedded_sql_hash -; (keyword_embedded_sql_hash) @keyword.directive -; ) -; (embedded_sql_amp -; (keyword_embedded_sql_amp) @keyword.directive -; "(" @keyword.directive -; ")" @keyword.directive -; (embedded_sql_reverse_marker) @keyword.directive -; ) - -(embedded_sql_amp - (keyword_embedded_sql_amp) @keyword.directive - "(" @keyword.directive - ")" @keyword.directive -) - -(embedded_sql_hash - (keyword_embedded_sql_hash) @keyword.directive - "(" @keyword.directive - ")" @keyword.directive -) - -(embedded_js - (keyword_embedded_js) @keyword.directive - "<" @keyword.directive - ">" @keyword.directive -) - -(embedded_xml - (keyword_embedded_xml) @keyword.directive - "<" @keyword.directive - ">" @keyword.directive -) - -(tag) @label - -; Lock type specifications -(locktype) @type.qualifier - - -(_ keyword: (_) @keyword) - -; (identifier) @variable - - -; Alternatively -; (class_statement (_ class_statement_keyword: (_) @keyword ) .) -"{" @punctuation.bracket -"}" @punctuation.bracket - -; @class.name capture group is not suppported in nvim highlighter -; (class_definition class_name: (identifier) @class.name) -(include_clause (identifier) @keyword.import) -(property (identifier) @property) -(parameter (identifier) @constant) -(projection (identifier) @type.definition) -(trigger (identifier) @type.definition) -(index (identifier) @type.definition) -(relationship (identifier) @type.definition) -(foreignkey (identifier) @type.definition) -(xdata (identifier) @constant) -(typename) @type -(class_definition - class_name: (identifier) @type - (class_extends (identifier) @type)) -(method_definition (identifier (identifier)) @function) -(query (identifier) @function) - -(argument (identifier) @variable.parameter) - -(keyword_name) @keyword - -(class_keywords (_ rhs: _ @constant.builtin)) -(parameter_keywords (_ rhs: _ @constant.builtin)) -(property_keywords (_ rhs: _ @constant.builtin)) -(xdata_keywords (_ rhs: _ @constant.builtin)) -(method_keywords (_ rhs: _ @constant.builtin)) -(trigger_keywords (_ rhs: _ @constant.builtin)) -(query_keywords (_ rhs: _ @constant.builtin)) -(index_keywords (_ rhs: _ @constant.builtin)) -(foreignkey_keywords (_ rhs: _ @constant.builtin)) -(projection_keywords (_ rhs: _ @constant.builtin)) -(relationship_keywords (_ rhs: _ @constant.builtin)) - -(documatic_line) @comment.doc - diff --git a/languages/objectscript_udl/indents.scm b/languages/objectscript_udl/indents.scm deleted file mode 100644 index 48c5004..0000000 --- a/languages/objectscript_udl/indents.scm +++ /dev/null @@ -1,38 +0,0 @@ -; Indentation rules for ObjectScript UDL (Zed) - -; --- Class Definition --- -; Indent everything inside the class_body’s braces. -(class_body "{" @start "}" @end) @indent - -; If individual class statements can wrap, indent their interior. -(class_body (class_statement) @indent) - -; --- Command arguments that may wrap across lines --- -(command_write (keyword_write) (write_argument) @indent) -(command_set (keyword_set) (set_argument) @indent) -(command_do (keyword_do) (do_parameter) @indent) -(command_kill (keyword_kill) (kill_argument) @indent) -(command_lock (keyword_lock) (command_lock_argument) @indent) -(command_read (keyword_read) (read_argument) @indent) -(command_open (keyword_open) (open_parameter) @indent) -(command_close (keyword_close) (close_parameter) @indent) -(command_use (keyword_use) (use_parameter) @indent) - -; --- Block-style commands delimited by braces --- -(command_while "{" @start "}" @end) @indent -(command_for "{" @start "}" @end) @indent -(command_if "{" @start "}" @end) @indent -(elseif_block "{" @start "}" @end) @indent -(else_block "{" @start "}" @end) @indent - -; --- Old-style FOR / IF / ELSE --- -(command_for (for_parameter) @indent) -(command_for (statement) @indent) -(command_if (expression) @indent) -(command_if (statement) @indent) -(command_else (statement) @indent) - -; --- Generic fallbacks for braces/parentheses spanning multiple lines --- -(_ "{" "}" @end) @indent -(_ "(" ")" @end) @indent - diff --git a/languages/objectscript_udl/injections.scm b/languages/objectscript_udl/injections.scm deleted file mode 100644 index 8e5c9d5..0000000 --- a/languages/objectscript_udl/injections.scm +++ /dev/null @@ -1,140 +0,0 @@ -; Target method_body_content and reparse it using -; objectscript_core - -(embedded_html - (angled_bracket_fenced_text) @injection.content - (#set! injection.language "html") - (#set! injection.include-children "false") - (#set! injection.combined "true") -) - -(embedded_sql - (_ - (paren_fenced_text) @injection.content - ) - (#set! injection.language "sql") - (#set! injection.include-children "false") - (#set! injection.combined "true") -) - -(embedded_js - (angled_bracket_fenced_text) @injection.content - (#set! injection.language "javascript") - (#set! injection.include-children "false") - (#set! injection.combined "true") -) - -(embedded_xml - (angled_bracket_fenced_text) @injection.content - (#set! injection.language "xml") - (#set! injection.include-children "false") - (#set! injection.combined "true") -) - -([ - (line_comment_1) - (line_comment_2) - (line_comment_3) - (block_comment) - (documatic_line) -] @injection.content - (#set! injection.language "comment")) - -;; Keywords, one of type language = "python", none of type codemode -(method_definition - keywords: - (_ - (kw_External_Language rhs: _ @injection.language) - ) - body: (_) @injection.content - (#set! injection.include-children "true") -) - -(trigger - keywords: - (_ - (kw_External_Language rhs: _ @injection.language) - ) - body: (_) @injection.content - (#set! injection.include-children "true") -) - -; A query must be of type %SQLQuery to have an SQL body, otherwise the body -; is empty -(query - type: (_ (typename (identifier) @_querytype (#eq? @_querytype "%SQLQuery"))) - (_ (query_body_content) @injection.content) - (#set! injection.language "sql") - (#set! injection.include-children "true") -) - -; XDATA blocks. There's a MimeType keyword that defines the content-type -; To prevent overlapping matches, we use a different body for the case where -; no MimeType is given and default to XML, otherwise we extract the language -; from the mimetype. - -(xdata - keywords: - (_ - (kw_MimeType rhs: _ @_mimetype (#eq? @_mimetype "\"text/markdown\"")) - ) - body: (xdata_body_content_any) @injection.content - (#set! injection.language "markdown") - (#set! injection.include-children "true") -) - -(xdata - keywords: - (_ - (kw_MimeType rhs: _ @_mimetype (#eq? @_mimetype "\"text/xml\"")) - ) - ; NOTE: Since MimeType is given, we match xdata_body_content_any not xml - body: (xdata_body_content_any) @injection.content - (#set! injection.language "xml") - (#set! injection.include-children "true") -) - -(xdata - keywords: - (_ - (kw_MimeType rhs: _ @_mimetype (#eq? @_mimetype "\"text/html\"")) - ) - body: (xdata_body_content_any) @injection.content - (#set! injection.language "html") - (#set! injection.include-children "true") -) - -(xdata - keywords: - (_ - (kw_MimeType rhs: _ @_mimetype (#eq? @_mimetype "\"application/json\"")) - ) - body: (xdata_body_content_any) @injection.content - (#set! injection.language "json") - (#set! injection.include-children "true") -) - -(xdata - keywords: - (_ - (kw_MimeType rhs: _ @_mimetype (#eq? @_mimetype "\"text/css\"")) - ) - body: (xdata_body_content_any) @injection.content - (#set! injection.language "css") - (#set! injection.include-children "true") -) - -; Match an unspecified XDATA -- defaults to XML -(xdata - body: (xdata_body_content_xml) @injection.content - (#set! injection.language "xml") - (#set! injection.include-children "true") -) - -; Storage definition is XML -(storage - body: (_) @injection.content - (#set! injection.language "xml") - (#set! injection.include-children "true") -) - diff --git a/languages/objectscript_udl/locals.scm b/languages/objectscript_udl/locals.scm deleted file mode 100644 index e69de29..0000000