-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathClaudeOutput.sublime-syntax
More file actions
329 lines (286 loc) · 10.5 KB
/
ClaudeOutput.sublime-syntax
File metadata and controls
329 lines (286 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
%YAML 1.2
---
name: Claude Output
scope: text.claude
file_extensions: []
hidden: true
contexts:
main:
# Prompt starts with ◎ and ends with ▶
- match: '^◎ '
scope: claude.prompt.marker punctuation.definition.prompt.begin
push: prompt
prompt:
# Prompt text until closing ▶
- meta_scope: claude.prompt entity.name.section
- match: ' ▶$'
scope: claude.prompt.marker punctuation.definition.prompt.end
set: conversation
conversation:
# Next prompt ends this section (pop BEFORE matching the new prompt)
- match: '(?=^◎ )'
pop: true
# Done tag ends the conversation
- match: '^\s*@done\([^)]+\)$'
scope: claude.meta.done comment.line
pop: true
# Tool pending
- match: '^\s*☐ .+$'
scope: claude.tool.pending
# Tool done
- match: '^\s*✔ .+$'
scope: claude.tool.done
# Tool error
- match: '^\s*✘ .+$'
scope: claude.tool.error
# Interrupted marker
- match: '\*\[interrupted\]\*'
scope: claude.interrupted
# Tool output lines (│ prefix)
- match: '^\s*│ .+$'
scope: claude.tool.output
# Tool result arrow (→)
- match: ' → \d+ (files|matches).*$'
scope: claude.tool.result
# Permission request
- match: '^\s*(⚠)\s*(Allow)\s+(\w+)'
captures:
1: claude.permission.icon markup.warning
2: claude.permission.label
3: claude.permission.tool entity.name.function
# Permission buttons
- match: '\[Y\] Allow'
scope: claude.permission.button.allow
- match: '\[N\] Deny'
scope: claude.permission.button.deny
- match: '\[A\] Allow all \w+'
scope: claude.permission.button.allowall
# Fenced code blocks with language embedding
- match: '^(\s*)(```)(python|py)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.python
embed_scope: markup.raw.block.markdown source.python.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(nim)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.nim
embed_scope: markup.raw.block.markdown source.nim.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(js|javascript)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.js
embed_scope: markup.raw.block.markdown source.js.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(ts|typescript)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.ts
embed_scope: markup.raw.block.markdown source.ts.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(json)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.json
embed_scope: markup.raw.block.markdown source.json.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(sh|bash|shell)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.shell.bash
embed_scope: markup.raw.block.markdown source.shell.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(rust|rs)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.rust
embed_scope: markup.raw.block.markdown source.rust.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(go|golang)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.go
embed_scope: markup.raw.block.markdown source.go.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(c)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.c
embed_scope: markup.raw.block.markdown source.c.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(cpp|c\+\+)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.c++
embed_scope: markup.raw.block.markdown source.c++.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(yaml|yml)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.yaml
embed_scope: markup.raw.block.markdown source.yaml.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(html)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:text.html.basic
embed_scope: markup.raw.block.markdown text.html.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(css)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.css
embed_scope: markup.raw.block.markdown source.css.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(sql)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.sql
embed_scope: markup.raw.block.markdown source.sql.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(ruby|rb)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.ruby
embed_scope: markup.raw.block.markdown source.ruby.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(lua)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.lua
embed_scope: markup.raw.block.markdown source.lua.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(diff)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:source.diff
embed_scope: markup.raw.block.markdown source.diff.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
- match: '^(\s*)(```)(xml)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
embed: scope:text.xml
embed_scope: markup.raw.block.markdown text.xml.embedded
escape: ^\1```\s*$
escape_captures:
0: punctuation.definition.code.end.markdown
# Generic fenced block (no language or unknown)
- match: '^(\s*)(```)(\w*)\s*$'
captures:
2: punctuation.definition.code.begin.markdown
3: constant.other.language-name.markdown
push: generic_code_block
# Markdown: Headings
- match: '^(#{1,6})\s+(.+)$'
captures:
1: punctuation.definition.heading.markdown
2: markup.heading.markdown entity.name.section.markdown
# Markdown: Bold **text** or __text__
- match: '(\*\*|__)(.+?)(\1)'
captures:
1: punctuation.definition.bold.begin.markdown
2: markup.bold.markdown
3: punctuation.definition.bold.end.markdown
# Markdown: Italic *text* or _text_
- match: '(?<!\*)(\*|_)(?!\s)(.+?)(?<!\s)(\1)(?!\*)'
captures:
1: punctuation.definition.italic.begin.markdown
2: markup.italic.markdown
3: punctuation.definition.italic.end.markdown
# Markdown: Inline code `code`
- match: '(`+)([^`]+)(\1)'
captures:
1: punctuation.definition.raw.begin.markdown
2: markup.raw.inline.markdown
3: punctuation.definition.raw.end.markdown
# Markdown: Links [text](url)
- match: '(\[)([^\]]+)(\])(\()([^\)]+)(\))'
captures:
1: punctuation.definition.link.begin.markdown
2: markup.underline.link.markdown string.other.link.title.markdown
3: punctuation.definition.link.end.markdown
4: punctuation.definition.metadata.begin.markdown
5: markup.underline.link.markdown
6: punctuation.definition.metadata.end.markdown
# Markdown: Unordered list items
- match: '^\s*([-*+])\s+'
captures:
1: punctuation.definition.list_item.markdown markup.list.unnumbered.markdown
# Markdown: Ordered list items
- match: '^\s*(\d+\.)\s+'
captures:
1: punctuation.definition.list_item.markdown markup.list.numbered.markdown
# Markdown: Blockquote
- match: '^\s*(>)\s*'
captures:
1: punctuation.definition.blockquote.markdown
push: blockquote
# Markdown: Horizontal rule
- match: '^\s*([-*_]){3,}\s*$'
scope: punctuation.definition.thematic-break.markdown
# Everything else is response text
- match: '.'
scope: claude.text
blockquote:
- meta_scope: markup.quote.markdown
- match: '$'
pop: true
generic_code_block:
- meta_scope: markup.raw.block.markdown
- match: '^\s*```\s*$'
scope: punctuation.definition.code.end.markdown
pop: true