Skip to content

Commit a0546b6

Browse files
committed
Add KQL and PromQL syntax definitions
1 parent f542fb1 commit a0546b6

File tree

4 files changed

+444
-0
lines changed

4 files changed

+444
-0
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<SyntaxDefinition name="KustoKQL" extensions=".kql">
4+
5+
<Environment>
6+
<Default color="#D4D4D4" bgcolor="#1E1E1E"/>
7+
<Selection color="#1E1E1E" bgcolor="#264F78"/>
8+
<LineNumbers color="#858585" bgcolor="#1E1E1E"/>
9+
<CaretMarker color="#AEAFAD"/>
10+
<VRuler color="#2A2A2A"/>
11+
12+
<FoldLine color="#858585" bgcolor="#1E1E1E"/>
13+
<FoldMarker color="#D4D4D4" bgcolor="#1E1E1E"/>
14+
<SelectedFoldLine color="#D4D4D4" bgcolor="#1E1E1E"/>
15+
16+
<EOLMarkers color="#404040"/>
17+
<SpaceMarkers color="#404040"/>
18+
<TabMarkers color="#404040"/>
19+
<InvalidLines color="#404040"/>
20+
</Environment>
21+
22+
<Properties>
23+
<Property name="LineComment" value="//"/>
24+
<Property name="BlockCommentBegin" value="/*"/>
25+
<Property name="BlockCommentEnd" value="*/"/>
26+
</Properties>
27+
28+
<Digits name="Digits" color="#B5CEA8"/>
29+
30+
<RuleSets>
31+
<RuleSet ignorecase="true">
32+
33+
<Delimiters>()[]{},:.@`=;+-*/%~ &amp;|^&gt;&lt;</Delimiters>
34+
35+
<Span name="LineComment" stopateol="true" color="#608B4E" bold="false" italic="false">
36+
<Begin>//</Begin>
37+
</Span>
38+
39+
<Span name="BlockComment" stopateol="false" color="#608B4E" bold="false" italic="false">
40+
<Begin>/*</Begin>
41+
<End>*/</End>
42+
</Span>
43+
44+
<Span name="StringSingle" stopateol="true" color="#CE9178" bold="false" italic="false" escapecharacter="\">
45+
<Begin>'</Begin>
46+
<End>'</End>
47+
</Span>
48+
49+
<Span name="StringDouble" stopateol="true" color="#CE9178" bold="false" italic="false" escapecharacter="\">
50+
<Begin>"</Begin>
51+
<End>"</End>
52+
</Span>
53+
54+
<KeyWords name="Keywords" color="#569CD6" bold="false" italic ="false">
55+
<Key word="let"/>
56+
<Key word="where"/>
57+
<Key word="project"/>
58+
<Key word="project-away"/>
59+
<Key word="project-rename"/>
60+
<Key word="extend"/>
61+
<Key word="summarize"/>
62+
<Key word="by"/>
63+
<Key word="distinct"/>
64+
<Key word="join"/>
65+
<Key word="inner"/>
66+
<Key word="leftouter"/>
67+
<Key word="rightouter"/>
68+
<Key word="fullouter"/>
69+
<Key word="lookup"/>
70+
<Key word="union"/>
71+
<Key word="take"/>
72+
<Key word="limit"/>
73+
<Key word="top"/>
74+
<Key word="order"/>
75+
<Key word="asc"/>
76+
<Key word="desc"/>
77+
<Key word="sort"/>
78+
<Key word="count"/>
79+
<Key word="dcount"/>
80+
<Key word="avg"/>
81+
<Key word="sum"/>
82+
<Key word="min"/>
83+
<Key word="max"/>
84+
<Key word="percentile"/>
85+
<Key word="make-series"/>
86+
<Key word="render"/>
87+
<Key word="parse"/>
88+
<Key word="extract"/>
89+
<Key word="mv-expand"/>
90+
<Key word="bag_unpack"/>
91+
<Key word="bag_keys"/>
92+
<Key word="has"/>
93+
<Key word="has_any"/>
94+
<Key word="has_all"/>
95+
<Key word="contains"/>
96+
<Key word="startswith"/>
97+
<Key word="endswith"/>
98+
<Key word="matches"/>
99+
<Key word="between"/>
100+
<Key word="in"/>
101+
<Key word="notin"/>
102+
<Key word="case"/>
103+
<Key word="iff"/>
104+
<Key word="tostring"/>
105+
<Key word="toint"/>
106+
<Key word="todouble"/>
107+
<Key word="toreal"/>
108+
<Key word="tobool"/>
109+
<Key word="todatetime"/>
110+
<Key word="ago"/>
111+
<Key word="now"/>
112+
<Key word="datetime"/>
113+
<Key word="datetime_add"/>
114+
<Key word="bin"/>
115+
<Key word="bin_at"/>
116+
</KeyWords>
117+
</RuleSet>
118+
</RuleSets>
119+
</SyntaxDefinition>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<SyntaxDefinition name="PromQL" extensions=".promql">
4+
5+
<Environment>
6+
<Default color="#D4D4D4" bgcolor="#1E1E1E"/>
7+
<Selection color="#1E1E1E" bgcolor="#264F78"/>
8+
<LineNumbers color="#858585" bgcolor="#1E1E1E"/>
9+
<CaretMarker color="#AEAFAD"/>
10+
<VRuler color="#2A2A2A"/>
11+
12+
<FoldLine color="#858585" bgcolor="#1E1E1E"/>
13+
<FoldMarker color="#D4D4D4" bgcolor="#1E1E1E"/>
14+
<SelectedFoldLine color="#D4D4D4" bgcolor="#1E1E1E"/>
15+
16+
<EOLMarkers color="#404040"/>
17+
<SpaceMarkers color="#404040"/>
18+
<TabMarkers color="#404040"/>
19+
<InvalidLines color="#404040"/>
20+
</Environment>
21+
22+
<Properties>
23+
<Property name="LineComment" value="#"/>
24+
</Properties>
25+
26+
<Digits name="Digits" color="#B5CEA8"/>
27+
28+
<RuleSets>
29+
<RuleSet ignorecase="true">
30+
31+
<Delimiters>()[]{},:.@`=;+-*/%~ &amp;|^&gt;&lt;!$</Delimiters>
32+
33+
<Span name="LineComment" stopateol="true" color="#608B4E" bold="false" italic="false">
34+
<Begin>#</Begin>
35+
</Span>
36+
37+
<Span name="String" stopateol="true" color="#CE9178" bold="false" italic="false" escapecharacter="\">
38+
<Begin>"</Begin>
39+
<End>"</End>
40+
</Span>
41+
42+
<KeyWords name="Keywords" color="#569CD6" bold="false" italic ="false">
43+
<Key word="sum"/>
44+
<Key word="min"/>
45+
<Key word="max"/>
46+
<Key word="avg"/>
47+
<Key word="count"/>
48+
<Key word="count_values"/>
49+
<Key word="stddev"/>
50+
<Key word="stdvar"/>
51+
<Key word="bottomk"/>
52+
<Key word="topk"/>
53+
<Key word="quantile"/>
54+
55+
<Key word="by"/>
56+
<Key word="without"/>
57+
<Key word="on"/>
58+
<Key word="ignoring"/>
59+
<Key word="group_left"/>
60+
<Key word="group_right"/>
61+
<Key word="offset"/>
62+
<Key word="bool"/>
63+
64+
<Key word="and"/>
65+
<Key word="or"/>
66+
<Key word="unless"/>
67+
68+
<Key word="rate"/>
69+
<Key word="irate"/>
70+
<Key word="increase"/>
71+
<Key word="delta"/>
72+
<Key word="idelta"/>
73+
<Key word="avg_over_time"/>
74+
<Key word="sum_over_time"/>
75+
<Key word="min_over_time"/>
76+
<Key word="max_over_time"/>
77+
<Key word="count_over_time"/>
78+
<Key word="quantile_over_time"/>
79+
<Key word="stddev_over_time"/>
80+
<Key word="stdvar_over_time"/>
81+
<Key word="predict_linear"/>
82+
<Key word="holt_winters"/>
83+
<Key word="time"/>
84+
<Key word="vector"/>
85+
<Key word="scalar"/>
86+
<Key word="label_replace"/>
87+
<Key word="label_join"/>
88+
<Key word="clamp_min"/>
89+
<Key word="clamp_max"/>
90+
<Key word="abs"/>
91+
<Key word="ceil"/>
92+
<Key word="floor"/>
93+
<Key word="sqrt"/>
94+
<Key word="ln"/>
95+
<Key word="log2"/>
96+
<Key word="log10"/>
97+
<Key word="exp"/>
98+
<Key word="round"/>
99+
<Key word="trunc"/>
100+
</KeyWords>
101+
</RuleSet>
102+
</RuleSets>
103+
</SyntaxDefinition>
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<SyntaxDefinition name="KustoKQL" extensions=".kql">
4+
5+
<Environment>
6+
<Default color="Black" bgcolor="#FFFFFF"/>
7+
<Selection color="Black" bgcolor="#C3C3FF"/>
8+
<LineNumbers color="Gray" bgcolor="#FFFFFF"/>
9+
<CaretMarker color="#F0F0F1"/>
10+
<VRuler color="#E0E0E5"/>
11+
12+
<FoldLine color="#A0A0A0" bgcolor="#FFFFFF"/>
13+
<FoldMarker color="Black" bgcolor="#FFFFFF"/>
14+
<SelectedFoldLine color="Black" bgcolor="#FFFFFF"/>
15+
16+
<EOLMarkers color="#CACAD2"/>
17+
<SpaceMarkers color="#B6B6C0"/>
18+
<TabMarkers color="#B6B6C0"/>
19+
<InvalidLines color="#B6B6C0"/>
20+
</Environment>
21+
22+
<Properties>
23+
<Property name="LineComment" value="//"/>
24+
<Property name="BlockCommentBegin" value="/*"/>
25+
<Property name="BlockCommentEnd" value="*/"/>
26+
</Properties>
27+
28+
<Digits name="Digits" color="Teal"/>
29+
30+
<RuleSets>
31+
<RuleSet ignorecase="true">
32+
33+
<Delimiters>()[]{},:.@`=;+-*/%~ &amp;|^&gt;&lt;</Delimiters>
34+
35+
<Span name="LineComment" stopateol="true" color="Green" bold="false" italic="false">
36+
<Begin>//</Begin>
37+
</Span>
38+
39+
<Span name="BlockComment" stopateol="false" color="Green" bold="false" italic="false">
40+
<Begin>/*</Begin>
41+
<End>*/</End>
42+
</Span>
43+
44+
<Span name="StringSingle" stopateol="true" color="Maroon" bold="false" italic="false" escapecharacter="\">
45+
<Begin>'</Begin>
46+
<End>'</End>
47+
</Span>
48+
49+
<Span name="StringDouble" stopateol="true" color="Maroon" bold="false" italic="false" escapecharacter="\">
50+
<Begin>"</Begin>
51+
<End>"</End>
52+
</Span>
53+
54+
<KeyWords name="Keywords" color="Blue" bold="false" italic ="false">
55+
<Key word="let"/>
56+
<Key word="where"/>
57+
<Key word="project"/>
58+
<Key word="project-away"/>
59+
<Key word="project-rename"/>
60+
<Key word="extend"/>
61+
<Key word="summarize"/>
62+
<Key word="by"/>
63+
<Key word="distinct"/>
64+
<Key word="join"/>
65+
<Key word="inner"/>
66+
<Key word="leftouter"/>
67+
<Key word="rightouter"/>
68+
<Key word="fullouter"/>
69+
<Key word="lookup"/>
70+
<Key word="union"/>
71+
<Key word="take"/>
72+
<Key word="limit"/>
73+
<Key word="top"/>
74+
<Key word="order"/>
75+
<Key word="asc"/>
76+
<Key word="desc"/>
77+
<Key word="sort"/>
78+
<Key word="count"/>
79+
<Key word="dcount"/>
80+
<Key word="avg"/>
81+
<Key word="sum"/>
82+
<Key word="min"/>
83+
<Key word="max"/>
84+
<Key word="percentile"/>
85+
<Key word="make-series"/>
86+
<Key word="render"/>
87+
<Key word="parse"/>
88+
<Key word="extract"/>
89+
<Key word="mv-expand"/>
90+
<Key word="bag_unpack"/>
91+
<Key word="bag_keys"/>
92+
<Key word="has"/>
93+
<Key word="has_any"/>
94+
<Key word="has_all"/>
95+
<Key word="contains"/>
96+
<Key word="startswith"/>
97+
<Key word="endswith"/>
98+
<Key word="matches"/>
99+
<Key word="between"/>
100+
<Key word="in"/>
101+
<Key word="notin"/>
102+
<Key word="case"/>
103+
<Key word="iff"/>
104+
<Key word="tostring"/>
105+
<Key word="toint"/>
106+
<Key word="todouble"/>
107+
<Key word="toreal"/>
108+
<Key word="tobool"/>
109+
<Key word="todatetime"/>
110+
<Key word="ago"/>
111+
<Key word="now"/>
112+
<Key word="datetime"/>
113+
<Key word="datetime_add"/>
114+
<Key word="bin"/>
115+
<Key word="bin_at"/>
116+
</KeyWords>
117+
</RuleSet>
118+
</RuleSets>
119+
</SyntaxDefinition>

0 commit comments

Comments
 (0)