Add KQL and PromQL syntax definitions
Some checks failed
build / build (push) Has been cancelled
build / publish (push) Has been cancelled

This commit is contained in:
ema
2026-02-10 02:24:08 +08:00
parent f542fb1107
commit a0546b6391
4 changed files with 444 additions and 0 deletions

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<SyntaxDefinition name="KustoKQL" extensions=".kql">
<Environment>
<Default color="#D4D4D4" bgcolor="#1E1E1E"/>
<Selection color="#1E1E1E" bgcolor="#264F78"/>
<LineNumbers color="#858585" bgcolor="#1E1E1E"/>
<CaretMarker color="#AEAFAD"/>
<VRuler color="#2A2A2A"/>
<FoldLine color="#858585" bgcolor="#1E1E1E"/>
<FoldMarker color="#D4D4D4" bgcolor="#1E1E1E"/>
<SelectedFoldLine color="#D4D4D4" bgcolor="#1E1E1E"/>
<EOLMarkers color="#404040"/>
<SpaceMarkers color="#404040"/>
<TabMarkers color="#404040"/>
<InvalidLines color="#404040"/>
</Environment>
<Properties>
<Property name="LineComment" value="//"/>
<Property name="BlockCommentBegin" value="/*"/>
<Property name="BlockCommentEnd" value="*/"/>
</Properties>
<Digits name="Digits" color="#B5CEA8"/>
<RuleSets>
<RuleSet ignorecase="true">
<Delimiters>()[]{},:.@`=;+-*/%~ &amp;|^&gt;&lt;</Delimiters>
<Span name="LineComment" stopateol="true" color="#608B4E" bold="false" italic="false">
<Begin>//</Begin>
</Span>
<Span name="BlockComment" stopateol="false" color="#608B4E" bold="false" italic="false">
<Begin>/*</Begin>
<End>*/</End>
</Span>
<Span name="StringSingle" stopateol="true" color="#CE9178" bold="false" italic="false" escapecharacter="\">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span name="StringDouble" stopateol="true" color="#CE9178" bold="false" italic="false" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<KeyWords name="Keywords" color="#569CD6" bold="false" italic ="false">
<Key word="let"/>
<Key word="where"/>
<Key word="project"/>
<Key word="project-away"/>
<Key word="project-rename"/>
<Key word="extend"/>
<Key word="summarize"/>
<Key word="by"/>
<Key word="distinct"/>
<Key word="join"/>
<Key word="inner"/>
<Key word="leftouter"/>
<Key word="rightouter"/>
<Key word="fullouter"/>
<Key word="lookup"/>
<Key word="union"/>
<Key word="take"/>
<Key word="limit"/>
<Key word="top"/>
<Key word="order"/>
<Key word="asc"/>
<Key word="desc"/>
<Key word="sort"/>
<Key word="count"/>
<Key word="dcount"/>
<Key word="avg"/>
<Key word="sum"/>
<Key word="min"/>
<Key word="max"/>
<Key word="percentile"/>
<Key word="make-series"/>
<Key word="render"/>
<Key word="parse"/>
<Key word="extract"/>
<Key word="mv-expand"/>
<Key word="bag_unpack"/>
<Key word="bag_keys"/>
<Key word="has"/>
<Key word="has_any"/>
<Key word="has_all"/>
<Key word="contains"/>
<Key word="startswith"/>
<Key word="endswith"/>
<Key word="matches"/>
<Key word="between"/>
<Key word="in"/>
<Key word="notin"/>
<Key word="case"/>
<Key word="iff"/>
<Key word="tostring"/>
<Key word="toint"/>
<Key word="todouble"/>
<Key word="toreal"/>
<Key word="tobool"/>
<Key word="todatetime"/>
<Key word="ago"/>
<Key word="now"/>
<Key word="datetime"/>
<Key word="datetime_add"/>
<Key word="bin"/>
<Key word="bin_at"/>
</KeyWords>
</RuleSet>
</RuleSets>
</SyntaxDefinition>

View File

@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<SyntaxDefinition name="PromQL" extensions=".promql">
<Environment>
<Default color="#D4D4D4" bgcolor="#1E1E1E"/>
<Selection color="#1E1E1E" bgcolor="#264F78"/>
<LineNumbers color="#858585" bgcolor="#1E1E1E"/>
<CaretMarker color="#AEAFAD"/>
<VRuler color="#2A2A2A"/>
<FoldLine color="#858585" bgcolor="#1E1E1E"/>
<FoldMarker color="#D4D4D4" bgcolor="#1E1E1E"/>
<SelectedFoldLine color="#D4D4D4" bgcolor="#1E1E1E"/>
<EOLMarkers color="#404040"/>
<SpaceMarkers color="#404040"/>
<TabMarkers color="#404040"/>
<InvalidLines color="#404040"/>
</Environment>
<Properties>
<Property name="LineComment" value="#"/>
</Properties>
<Digits name="Digits" color="#B5CEA8"/>
<RuleSets>
<RuleSet ignorecase="true">
<Delimiters>()[]{},:.@`=;+-*/%~ &amp;|^&gt;&lt;!$</Delimiters>
<Span name="LineComment" stopateol="true" color="#608B4E" bold="false" italic="false">
<Begin>#</Begin>
</Span>
<Span name="String" stopateol="true" color="#CE9178" bold="false" italic="false" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<KeyWords name="Keywords" color="#569CD6" bold="false" italic ="false">
<Key word="sum"/>
<Key word="min"/>
<Key word="max"/>
<Key word="avg"/>
<Key word="count"/>
<Key word="count_values"/>
<Key word="stddev"/>
<Key word="stdvar"/>
<Key word="bottomk"/>
<Key word="topk"/>
<Key word="quantile"/>
<Key word="by"/>
<Key word="without"/>
<Key word="on"/>
<Key word="ignoring"/>
<Key word="group_left"/>
<Key word="group_right"/>
<Key word="offset"/>
<Key word="bool"/>
<Key word="and"/>
<Key word="or"/>
<Key word="unless"/>
<Key word="rate"/>
<Key word="irate"/>
<Key word="increase"/>
<Key word="delta"/>
<Key word="idelta"/>
<Key word="avg_over_time"/>
<Key word="sum_over_time"/>
<Key word="min_over_time"/>
<Key word="max_over_time"/>
<Key word="count_over_time"/>
<Key word="quantile_over_time"/>
<Key word="stddev_over_time"/>
<Key word="stdvar_over_time"/>
<Key word="predict_linear"/>
<Key word="holt_winters"/>
<Key word="time"/>
<Key word="vector"/>
<Key word="scalar"/>
<Key word="label_replace"/>
<Key word="label_join"/>
<Key word="clamp_min"/>
<Key word="clamp_max"/>
<Key word="abs"/>
<Key word="ceil"/>
<Key word="floor"/>
<Key word="sqrt"/>
<Key word="ln"/>
<Key word="log2"/>
<Key word="log10"/>
<Key word="exp"/>
<Key word="round"/>
<Key word="trunc"/>
</KeyWords>
</RuleSet>
</RuleSets>
</SyntaxDefinition>

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<SyntaxDefinition name="KustoKQL" extensions=".kql">
<Environment>
<Default color="Black" bgcolor="#FFFFFF"/>
<Selection color="Black" bgcolor="#C3C3FF"/>
<LineNumbers color="Gray" bgcolor="#FFFFFF"/>
<CaretMarker color="#F0F0F1"/>
<VRuler color="#E0E0E5"/>
<FoldLine color="#A0A0A0" bgcolor="#FFFFFF"/>
<FoldMarker color="Black" bgcolor="#FFFFFF"/>
<SelectedFoldLine color="Black" bgcolor="#FFFFFF"/>
<EOLMarkers color="#CACAD2"/>
<SpaceMarkers color="#B6B6C0"/>
<TabMarkers color="#B6B6C0"/>
<InvalidLines color="#B6B6C0"/>
</Environment>
<Properties>
<Property name="LineComment" value="//"/>
<Property name="BlockCommentBegin" value="/*"/>
<Property name="BlockCommentEnd" value="*/"/>
</Properties>
<Digits name="Digits" color="Teal"/>
<RuleSets>
<RuleSet ignorecase="true">
<Delimiters>()[]{},:.@`=;+-*/%~ &amp;|^&gt;&lt;</Delimiters>
<Span name="LineComment" stopateol="true" color="Green" bold="false" italic="false">
<Begin>//</Begin>
</Span>
<Span name="BlockComment" stopateol="false" color="Green" bold="false" italic="false">
<Begin>/*</Begin>
<End>*/</End>
</Span>
<Span name="StringSingle" stopateol="true" color="Maroon" bold="false" italic="false" escapecharacter="\">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span name="StringDouble" stopateol="true" color="Maroon" bold="false" italic="false" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<KeyWords name="Keywords" color="Blue" bold="false" italic ="false">
<Key word="let"/>
<Key word="where"/>
<Key word="project"/>
<Key word="project-away"/>
<Key word="project-rename"/>
<Key word="extend"/>
<Key word="summarize"/>
<Key word="by"/>
<Key word="distinct"/>
<Key word="join"/>
<Key word="inner"/>
<Key word="leftouter"/>
<Key word="rightouter"/>
<Key word="fullouter"/>
<Key word="lookup"/>
<Key word="union"/>
<Key word="take"/>
<Key word="limit"/>
<Key word="top"/>
<Key word="order"/>
<Key word="asc"/>
<Key word="desc"/>
<Key word="sort"/>
<Key word="count"/>
<Key word="dcount"/>
<Key word="avg"/>
<Key word="sum"/>
<Key word="min"/>
<Key word="max"/>
<Key word="percentile"/>
<Key word="make-series"/>
<Key word="render"/>
<Key word="parse"/>
<Key word="extract"/>
<Key word="mv-expand"/>
<Key word="bag_unpack"/>
<Key word="bag_keys"/>
<Key word="has"/>
<Key word="has_any"/>
<Key word="has_all"/>
<Key word="contains"/>
<Key word="startswith"/>
<Key word="endswith"/>
<Key word="matches"/>
<Key word="between"/>
<Key word="in"/>
<Key word="notin"/>
<Key word="case"/>
<Key word="iff"/>
<Key word="tostring"/>
<Key word="toint"/>
<Key word="todouble"/>
<Key word="toreal"/>
<Key word="tobool"/>
<Key word="todatetime"/>
<Key word="ago"/>
<Key word="now"/>
<Key word="datetime"/>
<Key word="datetime_add"/>
<Key word="bin"/>
<Key word="bin_at"/>
</KeyWords>
</RuleSet>
</RuleSets>
</SyntaxDefinition>

View File

@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<SyntaxDefinition name="PromQL" extensions=".promql">
<Environment>
<Default color="Black" bgcolor="#FFFFFF"/>
<Selection color="Black" bgcolor="#C3C3FF"/>
<LineNumbers color="Gray" bgcolor="#FFFFFF"/>
<CaretMarker color="#F0F0F1"/>
<VRuler color="#E0E0E5"/>
<FoldLine color="#A0A0A0" bgcolor="#FFFFFF"/>
<FoldMarker color="Black" bgcolor="#FFFFFF"/>
<SelectedFoldLine color="Black" bgcolor="#FFFFFF"/>
<EOLMarkers color="#CACAD2"/>
<SpaceMarkers color="#B6B6C0"/>
<TabMarkers color="#B6B6C0"/>
<InvalidLines color="#B6B6C0"/>
</Environment>
<Properties>
<Property name="LineComment" value="#"/>
</Properties>
<Digits name="Digits" color="Teal"/>
<RuleSets>
<RuleSet ignorecase="true">
<Delimiters>()[]{},:.@`=;+-*/%~ &amp;|^&gt;&lt;!$</Delimiters>
<Span name="LineComment" stopateol="true" color="Green" bold="false" italic="false">
<Begin>#</Begin>
</Span>
<Span name="String" stopateol="true" color="Maroon" bold="false" italic="false" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<KeyWords name="Keywords" color="Blue" bold="false" italic ="false">
<Key word="sum"/>
<Key word="min"/>
<Key word="max"/>
<Key word="avg"/>
<Key word="count"/>
<Key word="count_values"/>
<Key word="stddev"/>
<Key word="stdvar"/>
<Key word="bottomk"/>
<Key word="topk"/>
<Key word="quantile"/>
<Key word="by"/>
<Key word="without"/>
<Key word="on"/>
<Key word="ignoring"/>
<Key word="group_left"/>
<Key word="group_right"/>
<Key word="offset"/>
<Key word="bool"/>
<Key word="and"/>
<Key word="or"/>
<Key word="unless"/>
<Key word="rate"/>
<Key word="irate"/>
<Key word="increase"/>
<Key word="delta"/>
<Key word="idelta"/>
<Key word="avg_over_time"/>
<Key word="sum_over_time"/>
<Key word="min_over_time"/>
<Key word="max_over_time"/>
<Key word="count_over_time"/>
<Key word="quantile_over_time"/>
<Key word="stddev_over_time"/>
<Key word="stdvar_over_time"/>
<Key word="predict_linear"/>
<Key word="holt_winters"/>
<Key word="time"/>
<Key word="vector"/>
<Key word="scalar"/>
<Key word="label_replace"/>
<Key word="label_join"/>
<Key word="clamp_min"/>
<Key word="clamp_max"/>
<Key word="abs"/>
<Key word="ceil"/>
<Key word="floor"/>
<Key word="sqrt"/>
<Key word="ln"/>
<Key word="log2"/>
<Key word="log10"/>
<Key word="exp"/>
<Key word="round"/>
<Key word="trunc"/>
</KeyWords>
</RuleSet>
</RuleSets>
</SyntaxDefinition>