xh/assets/syntax/basic/http.sublime-syntax
2023-10-22 20:04:02 +08:00

34 lines
937 B
YAML

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: HTTP
file_extensions:
- http
- rest
scope: source.http
contexts:
main:
- match: ^(?:([a-zA-Z]+(-?))\s+)?\s*(\S+)(?:\s+(((?i)HTTP(-?))(\/)(\S+)))?$
scope: http.requestline
captures:
1: keyword.control.http
3: const.language.http
5: keyword.other.http
7: punctuation.separator.http
8: constant.numeric.http
- match: '^([\w\-]+)\s*(:) ?(.*)$'
scope: http.requestheaders
captures:
1: support.variable.http
2: punctuation.separator.http
3: string.other.http
- match: '^\s*((?i)HTTP(-?))(\/)(\S+)\s([1-5][0-9][0-9])\s(.*)$'
scope: http.responseLine
captures:
1: keyword.other.http
3: punctuation.separator.http
4: constant.numeric.http
4: constant.numeric.http
5: constant.numeric.http
6: keyword.reason.http