Skip to content

Commit 238fff7

Browse files
committed
✨ add vscodium / vscode language support thanks to @WebFreak001 and @cmrschwarz
1 parent 72d8ae5 commit 238fff7

6 files changed

Lines changed: 259 additions & 0 deletions

File tree

code-pointerscript/.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
.vscode-test/**
3+
.gitignore
4+
vsc-extension-quickstart.md

code-pointerscript/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# code-pointerscript
2+
3+
Language support for PointerScript
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"comments": {
3+
// symbol used for single line comment. Remove this entry if your language does not support line comments
4+
"lineComment": "//",
5+
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
6+
"blockComment": [ "/*", "*/" ]
7+
},
8+
// symbols used as brackets
9+
"brackets": [
10+
["{", "}"],
11+
["[", "]"],
12+
["(", ")"]
13+
],
14+
// symbols that are auto closed when typing
15+
"autoClosingPairs": [
16+
["{", "}"],
17+
["[", "]"],
18+
["(", ")"],
19+
["\"", "\""],
20+
["'", "'"]
21+
],
22+
// symbols that can be used to surround a selection
23+
"surroundingPairs": [
24+
["{", "}"],
25+
["[", "]"],
26+
["(", ")"],
27+
["\"", "\""],
28+
["'", "'"]
29+
]
30+
}

code-pointerscript/package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code-pointerscript/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "code-pointerscript",
3+
"displayName": "code-pointerscript",
4+
"description": "Language support for PointerScript",
5+
"version": "0.0.1",
6+
"engines": {
7+
"vscode": ">=1.100.0"
8+
},
9+
"categories": [
10+
"Programming Languages"
11+
],
12+
"contributes": {
13+
"languages": [{
14+
"id": "pointerscript",
15+
"aliases": ["PointerScript", "pointerscript"],
16+
"extensions": [".ptrs"],
17+
"configuration": "./language-configuration.json"
18+
}],
19+
"grammars": [{
20+
"language": "pointerscript",
21+
"scopeName": "source.pointerscript",
22+
"path": "./syntaxes/pointerscript.tmLanguage.json"
23+
}]
24+
}
25+
}
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3+
"name": "PointerScript",
4+
"scopeName": "source.pointerscript",
5+
"fileTypes": [
6+
"ptrs"
7+
],
8+
"patterns": [{
9+
"include": "#keyword"
10+
},
11+
{
12+
"include": "#shebang"
13+
},
14+
{
15+
"include": "#comment"
16+
},
17+
{
18+
"include": "#string"
19+
},
20+
{
21+
"include": "#number"
22+
},
23+
{
24+
"include": "#operator"
25+
},
26+
{
27+
"include": "#builtin-constant"
28+
},
29+
{
30+
"include": "#type"
31+
},
32+
{
33+
"include": "#call"
34+
},
35+
{
36+
"include": "#identifier"
37+
},
38+
{
39+
"include": "#punctuation"
40+
}
41+
],
42+
"repository": {
43+
"shebang": {
44+
"patterns": [{
45+
"name": "comment.block.shebang.pointerscript",
46+
"match": "^#!.*$"
47+
}]
48+
},
49+
"comment": {
50+
"patterns": [{
51+
"name": "comment.line.double-slash.pointerscript",
52+
"begin": "//",
53+
"end": "$"
54+
},
55+
{
56+
"name": "comment.block.pointerscript",
57+
"begin": "/\\*",
58+
"end": "\\*/"
59+
}
60+
]
61+
},
62+
"string": {
63+
"patterns": [{
64+
"name": "string.quoted.double.pointerscript",
65+
"begin": "\"",
66+
"end": "\"",
67+
"patterns": [{
68+
"include": "#escaped"
69+
}]
70+
},
71+
{
72+
"name": "string.quoted.single.pointerscript",
73+
"begin": "'",
74+
"end": "'",
75+
"patterns": [{
76+
"include": "#escaped"
77+
}]
78+
},
79+
{
80+
"name": "string.quoted.backtick.pointerscript",
81+
"begin": "`",
82+
"end": "`",
83+
"patterns": [{
84+
"include": "#escaped"
85+
}]
86+
}
87+
]
88+
},
89+
"escaped": {
90+
"patterns": [{
91+
"name": "constant.character.escape.pointerscript",
92+
"match": "\\\\."
93+
}]
94+
},
95+
"number": {
96+
"patterns": [{
97+
"name": "constant.numeric.pointerscript",
98+
"match": "-?\\b\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?\\b"
99+
}]
100+
},
101+
"keyword": {
102+
"patterns": [{
103+
"name": "keyword.control.pointerscript",
104+
"match": "\\b(break|continue|delete|throw|try|catch|finally|function|struct|switch|if|else|loop|while|do|for|foreach|return|import|as|in|from|var|const|sizeof|new|new_stack|operator|constructor|destructor|private|public|internal|static|get|set|default|case|instanceof|type|typeof|map|map_stack|cast|throw)\\b"
105+
}]
106+
},
107+
"operator": {
108+
"patterns": [{
109+
"name": "keyword.operator.pointerscript",
110+
"match": "(===|!==|==|!=|<=|>=|<<=|>>=|\\+\\+|--|\\+=|-=|\\*=|/=|%=|>>|<<|&&|\\|\\||\\^\\^|\\||\\^|&|=|\\?|:|\\+|\\-|\\*|/|%|!|~|\\.|,)"
111+
}]
112+
},
113+
"type": {
114+
"patterns": [{
115+
"name": "storage.type.builtin.pointerscript",
116+
"match": "\\b(undefined|int|float|pointer|struct|function)\\b"
117+
},
118+
{
119+
"name": "storage.type.native.pointerscript",
120+
"match": "\\b(char|short|int|long|longlong|uchar|ushort|uint|ulong|ulonglong|i8|i16|i32|i64|u8|u16|u32|u64|float|double|f32|f64|cfunc|pointer|bool|ssize|size|intptr|uintptr|ptrdiff|var)\\b"
121+
}
122+
]
123+
},
124+
"builtin-constant": {
125+
"patterns": [{
126+
"name": "constant.language.pointerscript",
127+
"match": "\\b(true|false|null|undefined|NaN|Infinity|PI|E)\\b"
128+
}]
129+
},
130+
"call": {
131+
"patterns": [{
132+
"match": "\\b([_a-zA-Z][_a-zA-Z0-9]*)\\b\\s*(\\()",
133+
"captures": {
134+
"1": {
135+
"name": "entity.name.function.pointerscript"
136+
}
137+
}
138+
}]
139+
},
140+
"identifier": {
141+
"patterns": [{
142+
"name": "variable.other.pointerscript",
143+
"match": "\\b[_a-zA-Z][_a-zA-Z0-9]*\\b"
144+
}]
145+
},
146+
"punctuation": {
147+
"patterns": [{
148+
"name": "punctuation.terminator.statement.pointerscript",
149+
"match": ";"
150+
},
151+
{
152+
"name": "punctuation.separator.parameter.pointerscript",
153+
"match": ","
154+
},
155+
{
156+
"name": "punctuation.section.block.begin.pointerscript",
157+
"match": "\\{"
158+
},
159+
{
160+
"name": "punctuation.section.block.end.pointerscript",
161+
"match": "\\}"
162+
},
163+
{
164+
"name": "punctuation.section.group.begin.pointerscript",
165+
"match": "\\("
166+
},
167+
{
168+
"name": "punctuation.section.group.end.pointerscript",
169+
"match": "\\)"
170+
},
171+
{
172+
"name": "punctuation.section.array.begin.pointerscript",
173+
"match": "\\["
174+
},
175+
{
176+
"name": "punctuation.section.array.end.pointerscript",
177+
"match": "\\]"
178+
}
179+
]
180+
}
181+
}
182+
}

0 commit comments

Comments
 (0)