-
Notifications
You must be signed in to change notification settings - Fork 3
/
REST.sublime-syntax
46 lines (40 loc) · 1.01 KB
/
REST.sublime-syntax
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
%YAML 1.2
---
name: REST
file_extensions: [rest, http]
scope: source.http
prototype:
- include: comments
contexts:
main:
- match: ^\s*(@)([^\s=]+)\s*=\s*(.*?)\s*$
name: http.variables
captures:
1: keyword.other.http
2: variable.parameter
3: string.other.http
- match: ^[^#]*(#.*)\s*$
name: http.comments
captures:
1: comment.line.sharp
- match: ^\s*(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|CONNECT|TRACE)
name: http.methods
captures:
1: keyword.control.http
- match: (\{{2})([^}]+)(\}{2})
name: http.variables
captures:
1: string.other.http
2: variable.parameter
3: string.other.http
- match: ^\s*([\w\-]+\s*\:)\s+(.*?)
name: http.headers
captures:
1: entity.name.tag.http
2: variable.parameter
- match: ^[\{\[][\W]+$
name: http.json
push: Packages/JSON/JSON.sublime-syntax
with_prototype:
- match: ^[\}\]][\W]+$
pop: true