Skip to main content

INJECTIONS_QUERY

Constant INJECTIONS_QUERY 

Source
pub const INJECTIONS_QUERY: &str = "; AUTO-GENERATED by scripts/sync_queries.py\n; Edit only the LOCAL section in composed files.\n; File: injections.scm\n; === BEGIN CORE ===\n(embedded_html\n  (angled_bracket_fenced_text) @injection.content\n  (#set! injection.language \"html\"))\n\n(embedded_sql\n  (_\n    (paren_fenced_text) @injection.content)\n  (#set! injection.language \"sql\"))\n\n(embedded_js\n  [\n    (angled_bracket_fenced_text)\n    (embedded_js_special_case)\n  ] @injection.content\n  (#set! injection.language \"javascript\"))\n\n(embedded_xml\n  (angled_bracket_fenced_text) @injection.content\n  (#set! injection.language \"xml\"))\n\n; === END CORE ===\n; === BEGIN LOCAL ===\n; Keywords, one of type language = \"python\", none of type codemode\n; External method body injection based on [ Language = ... ]\n(method_definition\n  (method_keyword_external_language\n    (typename) @_lang)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_lang \"python\" \"Python\" \"PYTHON\")\n  (#set! injection.language \"python\"))\n\n(method_definition\n  (method_keyword_external_language\n    (typename) @_lang)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_lang \"tsql\" \"TSQL\" \"tSQL\" \"tSql\" \"TSql\")\n  (#set! injection.language \"tsql\"))\n\n(method_definition\n  (method_keyword_external_language\n    (typename) @_lang)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_lang \"ispl\" \"ISPL\" \"ISpl\" \"iSpl\")\n  (#set! injection.language \"ispl\"))\n\n(trigger\n  (method_keyword_external_language\n    (typename) @_lang)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_lang \"python\" \"Python\" \"PYTHON\")\n  (#set! injection.language \"python\"))\n\n(trigger\n  (method_keyword_external_language\n    (typename) @_lang)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_lang \"tsql\" \"TSQL\" \"tSQL\" \"tSql\" \"TSql\")\n  (#set! injection.language \"tsql\"))\n\n; A query must be of type %SQLQuery to have an SQL body, otherwise the body\n; is empty\n(query\n  (return_type\n    (typename\n      (identifier) @_querytype\n      (#any-of? @_querytype \"%SqlQuery\" \"%sqlquery\" \"%SQLQUERY\" \"%Sqlquery\" \"%SQLQuery\")))\n  (external_method_body_content) @injection.content\n  (#set! injection.language \"sql\")\n  (#set! injection.include-children \"true\"))\n\n; XDATA blocks:\n; - xdata_any requires a keyword list that includes MimeType\n; - xdata_xml allows an optional keyword list and defaults to XML\n; ----------------------------\n; XDATA injections (MimeType)\n; ----------------------------\n; text/markdown\n;\n(xdata\n  (xdata_keyword_mimetype\n    (typename) @_mt)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_mt \"text/markdown\" \"\\\"text/markdown\\\"\")\n  (#set! injection.language \"markdown\"))\n\n(xdata\n  (xdata_keyword_mimetype\n    (typename) @_mt)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_mt \"text/x-python\" \"\\\"text/x-python\\\"\" \"application/python\" \"\\\"application/python\\\"\")\n  (#set! injection.language \"python\"))\n\n(xdata\n  (xdata_keyword_mimetype\n    (typename) @_mt)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_mt \"text/xml\" \"\\\"text/xml\\\"\" \"application/xml\" \"\\\"application/xml\\\"\")\n  (#set! injection.language \"xml\"))\n\n(xdata\n  (xdata_keyword_mimetype\n    (typename) @_mt)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_mt \"text/html\" \"\\\"text/html\\\"\")\n  (#set! injection.language \"html\"))\n\n(xdata\n  (xdata_keyword_mimetype\n    (typename) @_mt)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_mt \"application/json\" \"\\\"application/json\\\"\")\n  (#set! injection.language \"json\"))\n\n(xdata\n  (xdata_keyword_mimetype\n    (typename) @_mt)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_mt \"text/yaml\" \"\\\"text/yaml\\\"\" \"application/yaml\" \"\\\"application/yaml\\\"\")\n  (#set! injection.language \"yaml\"))\n\n(xdata\n  (xdata_keyword_mimetype\n    (typename) @_mt)\n  (external_method_body_content) @injection.content\n  (#set! injection.include-children \"true\")\n  (#any-of? @_mt \"text/css\" \"\\\"text/css\\\"\")\n  (#set! injection.language \"css\"))\n\n; --------------------------------------------\n; XDATA default (no MimeType header): XML fallback\n; --------------------------------------------\n((xdata\n  (external_method_body_content) @injection.content) @_xdata\n  (#not-match? @_xdata \"^[^{}]*[Mm][Ii][Mm][Ee][Tt][Yy][Pp][Ee][ \\t\\r\\n]*=\")\n  (#set! injection.include-children \"true\")\n  (#set! injection.language \"xml\"))\n\n; Storage definition is XML\n(storage\n  (external_method_body_content) @injection.content\n  (#set! injection.language \"xml\")\n  (#set! injection.include-children \"true\"))\n\n([\n  (line_comment_1)\n  (line_comment_2)\n  (line_comment_3)\n  (line_comment_4)\n  (block_comment)\n  (inline_comment)\n  (argumentless_inline_comment)\n  (documatic_line)\n] @injection.content\n  (#set! injection.language \"comment\"))\n\n; === END LOCAL ===\n";
Expand description

The injections query for ObjectScript UDL.