Skip to content

Commit 4df1e24

Browse files
committed
1.2.0
Remodel syntax highlighting
1 parent 94a7efb commit 4df1e24

File tree

6 files changed

+176
-160
lines changed

6 files changed

+176
-160
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ restructuredpython/vsc-extension-quickstart.md
22
restructuredpython/restructuredpython-0.0.1.vsix
33
restructuredpython/restructuredpython-1.1.0.vsix
44
restructuredpython/restructuredpython-1.1.1.vsix
5+
*.vsix

restructuredpython/.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.vscode/**
22
.vscode-test/**
33
.gitignore
4-
vsc-extension-quickstart.md
4+
vsc-extension-quickstart.md

restructuredpython/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Change Log
1+
# Changelog
22

3-
All notable changes to the "restructuredpython" extension will be documented in this file.
3+
All notable changes to the "restructuredpython" extension will be documented in this file. Versions older than 1.2.0 will not be documented.
44

55

6-
## [Unreleased]
6+
## 1.2.0
77

8-
- Initial release
8+
- Remodeled syntax highlighting

restructuredpython/language-configuration.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"comments": {
33
"lineComment": "#",
4+
"blockComment": ["/*", "*/"]
45
},
56
"brackets": [
67
["{", "}"],

restructuredpython/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "restructuredpython",
33
"displayName": "reStructuredPython",
44
"description": "Support for the language reStructuredPython",
5-
"version": "1.1.1",
5+
"version": "1.2.0",
66
"publisher": "RihaanMeher",
77
"icon": "icons/icon.png",
88
"repository": {
Lines changed: 168 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1,175 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3-
"name": "reStructuredPython",
4-
"patterns": [
5-
{
6-
"include": "#keywords"
7-
},
8-
{
9-
"include": "#functions"
10-
},
11-
{
12-
"include": "#variables"
13-
},
14-
{
15-
"include": "#numbers"
16-
},
17-
{
18-
"include": "#strings"
19-
},
20-
{
21-
"include": "#comments"
22-
},
23-
{
24-
"include": "#braces"
25-
},
26-
{
27-
"include": "#parentheses"
28-
}
29-
],
30-
"repository": {
31-
"keywords": {
32-
"patterns": [
33-
{
34-
"name": "keyword.control.restructuredpython",
35-
"match": "\\b(if|for|while|def|elif|else|class|with|import|include)\\b"
36-
}
37-
]
38-
},
39-
"functions": {
40-
"patterns": [
41-
{
42-
"name": "entity.name.function.restructuredpython",
43-
"match": "\\bdef\\s+([A-Za-z_][A-Za-z0-9_]*)\\b"
44-
}
45-
]
46-
},
2+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3+
"name": "reStructuredPython",
4+
"patterns": [
5+
{ "include": "#storage" },
6+
{ "include": "#keywords" },
7+
{ "include": "#functions" },
8+
{ "include": "#variables" },
9+
{ "include": "#numbers" },
10+
{ "include": "#strings" },
11+
{ "include": "#comments" },
12+
{ "include": "#braces" },
13+
{ "include": "#parentheses" }
14+
],
15+
"repository": {
16+
"storage": {
17+
"patterns": [
18+
{
19+
"name": "storage.control.restructuredpython",
20+
"match": "\\b(if|for|while|def|elif|else|class|with|import|include|match|case|None|and|as|global|from|in|is|lambda|nonlocal|not|or)\\b|\\|>"
21+
22+
}
23+
]
24+
},
25+
"keywords": {
26+
"patterns": [
27+
{
28+
"name": "keyword.control.restructuredpython",
29+
"match": "\\b(True|False|pass|assert|async|await|break|continue|del|raise|return|yield)\\b"
30+
}
31+
]
32+
},
33+
"functions": {
34+
"patterns": [
35+
{
36+
"name": "entity.name.function.restructuredpython",
37+
"match": "\\bdef\\s+([A-Za-z_][A-Za-z0-9_]*)\\b"
38+
}
39+
]
40+
},
4741
"variables": {
4842
"patterns": [
4943
{
50-
"name": "variable.other.restructuredpython",
51-
"match": "\\b[A-Za-z_][A-Za-z0-9_]*\\b"
52-
}
53-
]
54-
},
55-
"numbers": {
56-
"patterns": [
57-
{
58-
"name": "constant.numeric.restructuredpython",
59-
"match": "\\b\\d+\\b"
60-
}
61-
]
62-
},
63-
"strings": {
64-
"patterns": [
65-
{
66-
"name": "string.quoted.double.restructuredpython",
67-
"begin": "\"\"\"",
68-
"end": "\"\"\"",
69-
"patterns": [
70-
{
71-
"name": "constant.character.escape.restructuredpython",
72-
"match": "\\\\."
73-
}
74-
]
75-
},
76-
{
77-
"name": "string.quoted.single.restructuredpython",
78-
"begin": "'''",
79-
"end": "'''",
80-
"patterns": [
81-
{
82-
"name": "constant.character.escape.restructuredpython",
83-
"match": "\\\\."
84-
}
85-
]
86-
},
87-
{
88-
"name": "string.quoted.double.singleline.restructuredpython",
89-
"begin": "\"",
90-
"end": "\"",
91-
"patterns": [
92-
{
93-
"name": "constant.character.escape.restructuredpython",
94-
"match": "\\\\."
95-
}
96-
]
97-
},
98-
{
99-
"name": "string.quoted.single.singleline.restructuredpython",
100-
"begin": "'",
101-
"end": "'",
102-
"patterns": [
103-
{
104-
"name": "constant.character.escape.restructuredpython",
105-
"match": "\\\\."
106-
}
107-
]
44+
"name": "variable.restructuredpython",
45+
"match": "(?<!\\.|\\d)\\b[A-Za-z_][A-Za-z0-9_]*\\b(?!\\s*\\()"
10846
}
10947
]
11048
},
111-
"comments": {
112-
"patterns": [
113-
{
114-
"name": "comment.line.restructuredpython",
115-
"begin": "#",
116-
"end": "$"
117-
},
118-
{
119-
"name": "comment.block.documentation.restructuredpython",
120-
"begin": "\"\"\"",
121-
"end": "\"\"\"",
122-
"patterns": [
123-
{
124-
"name": "comment.block.documentation.restructuredpython",
125-
"match": ".+"
126-
}
127-
]
128-
},
129-
{
130-
"name": "comment.block.documentation.restructuredpython",
131-
"begin": "'''",
132-
"end": "'''",
133-
"patterns": [
134-
{
135-
"name": "comment.block.documentation.restructuredpython",
136-
"match": ".+"
137-
}
138-
]
139-
}
140-
]
141-
},
142-
"braces": {
143-
"patterns": [
144-
{
145-
"name": "punctuation.definition.block.restructuredpython",
146-
"match": "[{}]"
147-
}
148-
]
149-
},
150-
"parentheses": {
151-
"patterns": [
152-
{
153-
"name": "punctuation.definition.group.restructuredpython",
154-
"match": "[()]"
155-
}
156-
]
157-
}
158-
},
159-
"scopeName": "source.restructuredpython"
160-
}
161-
49+
"numbers": {
50+
"patterns": [
51+
{
52+
"name": "constant.numeric.restructuredpython",
53+
"match": "\\b\\d+\\b"
54+
}
55+
]
56+
},
57+
"strings": {
58+
"patterns": [
59+
{
60+
"name": "string.quoted.double.restructuredpython",
61+
"begin": "\"\"\"",
62+
"end": "\"\"\"",
63+
"patterns": [
64+
{
65+
"name": "constant.character.escape.restructuredpython",
66+
"match": "\\\\."
67+
}
68+
]
69+
},
70+
{
71+
"name": "string.quoted.single.restructuredpython",
72+
"begin": "'''",
73+
"end": "'''",
74+
"patterns": [
75+
{
76+
"name": "constant.character.escape.restructuredpython",
77+
"match": "\\\\."
78+
}
79+
]
80+
},
81+
{
82+
"name": "string.quoted.double.singleline.restructuredpython",
83+
"begin": "\"",
84+
"end": "\"",
85+
"patterns": [
86+
{
87+
"name": "constant.character.escape.restructuredpython",
88+
"match": "\\\\."
89+
}
90+
]
91+
},
92+
{
93+
"name": "string.quoted.single.singleline.restructuredpython",
94+
"begin": "'",
95+
"end": "'",
96+
"patterns": [
97+
{
98+
"name": "constant.character.escape.restructuredpython",
99+
"match": "\\\\."
100+
}
101+
]
102+
}
103+
]
104+
},
105+
"comments": {
106+
"patterns": [
107+
{
108+
"name": "comment.line.restructuredpython",
109+
"begin": "#",
110+
"end": "$"
111+
},
112+
{
113+
"name": "comment.block.documentation.restructuredpython",
114+
"begin": "\"\"\"",
115+
"end": "\"\"\"",
116+
"patterns": [
117+
{
118+
"name": "comment.block.documentation.restructuredpython",
119+
"match": ".+"
120+
}
121+
]
122+
},
123+
{
124+
"name": "comment.block.documentation.restructuredpython",
125+
"begin": "'''",
126+
"end": "'''",
127+
"patterns": [
128+
{
129+
"name": "comment.block.documentation.restructuredpython",
130+
"match": ".+"
131+
}
132+
]
133+
},
134+
{
135+
"name": "comment.block.restructuredpython",
136+
"begin": "/\\*",
137+
"end": "\\*/",
138+
"beginCaptures": {
139+
"0": {
140+
"name": "punctuation.definition.comment.begin.restructuredpython"
141+
}
142+
},
143+
"endCaptures": {
144+
"0": {
145+
"name": "punctuation.definition.comment.end.restructuredpython"
146+
}
147+
},
148+
"patterns": [
149+
{
150+
"name": "comment.block.documentation.restructuredpython",
151+
"match": "/\\*\\*"
152+
}
153+
]
154+
}
155+
]
156+
},
157+
"braces": {
158+
"patterns": [
159+
{
160+
"name": "punctuation.definition.block.restructuredpython",
161+
"match": "[{}]"
162+
}
163+
]
164+
},
165+
"parentheses": {
166+
"patterns": [
167+
{
168+
"name": "punctuation.definition.group.restructuredpython",
169+
"match": "[()]"
170+
}
171+
]
172+
}
173+
},
174+
"scopeName": "source.restructuredpython"
175+
}

0 commit comments

Comments
 (0)