Skip to content

Commit 7d0fe18

Browse files
committed
feat: add initial VS Code extension for ProXPL with syntax highlighting, snippets, and language configuration.
1 parent f140eee commit 7d0fe18

5 files changed

Lines changed: 259 additions & 0 deletions

File tree

extension/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ProXPL VS Code Extension
2+
3+
Official language support for ProXPL.
4+
5+
## Features
6+
7+
- **Syntax Highlighting**: Supports keywords, types, operators, and comments.
8+
- **Snippets**: Quick boilerplate for `main` function and control flow.
9+
- **Language Configuration**: Smart brackets, auto-closing pairs, and indentation.
10+
11+
## Installation
12+
13+
To test locally:
14+
1. Open this `extension/` folder in VS Code.
15+
2. Press `F5` to open the Extension Development Host.
16+
3. Open or create a `.prox` file to see the extension in action.
17+
18+
## Development
19+
20+
- Grammar resides in `syntaxes/proxpl.tmLanguage.json`.
21+
- Snippets are defined in `snippets/proxpl-snippets.json`.
22+
- General settings are in `language-configuration.json`.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"comments": {
3+
"lineComment": "//",
4+
"blockComment": ["/*", "*/"]
5+
},
6+
"brackets": [
7+
["{", "}"],
8+
["[", "]"],
9+
["(", ")"]
10+
],
11+
"autoClosingPairs": [
12+
{ "open": "{", "close": "}" },
13+
{ "open": "[", "close": "]" },
14+
{ "open": "(", "close": ")" },
15+
{ "open": "\"", "close": "\"", "notIn": ["string"] },
16+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
17+
],
18+
"surroundingPairs": [
19+
["{", "}"],
20+
["[", "]"],
21+
["(", ")"],
22+
["\"", "\""],
23+
["'", "'"]
24+
],
25+
"folding": {
26+
"markers": {
27+
"start": "^\\s*//\\s*#?region\\b",
28+
"end": "^\\s*//\\s*#?endregion\\b"
29+
}
30+
},
31+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
32+
"indentationRules": {
33+
"increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
34+
"decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\)\\}\\]].*$"
35+
}
36+
}

extension/package.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "proxpl",
3+
"displayName": "ProXPL Language Support",
4+
"description": "Syntax highlighting and language support for the ProXPL programming language",
5+
"version": "1.0.0",
6+
"publisher": "ProgrammerKR",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/ProgrammerKR/ProXPL"
10+
},
11+
"engines": {
12+
"vscode": "^1.75.0"
13+
},
14+
"categories": [
15+
"Programming Languages"
16+
],
17+
"keywords": [
18+
"proxpl",
19+
"prox",
20+
"syntax",
21+
"highlighting"
22+
],
23+
"contributes": {
24+
"languages": [
25+
{
26+
"id": "proxpl",
27+
"aliases": [
28+
"ProXPL",
29+
"prox"
30+
],
31+
"extensions": [
32+
".prox"
33+
],
34+
"configuration": "./language-configuration.json"
35+
}
36+
],
37+
"grammars": [
38+
{
39+
"language": "proxpl",
40+
"scopeName": "source.proxpl",
41+
"path": "./syntaxes/proxpl.tmLanguage.json"
42+
}
43+
],
44+
"snippets": [
45+
{
46+
"language": "proxpl",
47+
"path": "./snippets/proxpl-snippets.json"
48+
}
49+
]
50+
}
51+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"Main Function": {
3+
"prefix": "main",
4+
"body": [
5+
"func main() {",
6+
"\t${1:// main code}",
7+
"}",
8+
"",
9+
"main();"
10+
],
11+
"description": "Main function entry point"
12+
},
13+
"If-Else block": {
14+
"prefix": "ifelse",
15+
"body": [
16+
"if (${1:condition}) {",
17+
"\t${2:// code}",
18+
"} else {",
19+
"\t${3:// code}",
20+
"}"
21+
],
22+
"description": "If-else block"
23+
},
24+
"If block": {
25+
"prefix": "if",
26+
"body": [
27+
"if (${1:condition}) {",
28+
"\t${2:// code}",
29+
"}"
30+
],
31+
"description": "If block"
32+
}
33+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3+
"name": "ProXPL",
4+
"scopeName": "source.proxpl",
5+
"patterns": [
6+
{
7+
"include": "#comments"
8+
},
9+
{
10+
"include": "#keywords"
11+
},
12+
{
13+
"include": "#types"
14+
},
15+
{
16+
"include": "#strings"
17+
},
18+
{
19+
"include": "#numbers"
20+
},
21+
{
22+
"include": "#booleans"
23+
},
24+
{
25+
"include": "#operators"
26+
},
27+
{
28+
"include": "#functions"
29+
}
30+
],
31+
"repository": {
32+
"comments": {
33+
"patterns": [
34+
{
35+
"name": "comment.line.double-slash.proxpl",
36+
"match": "//.*$"
37+
},
38+
{
39+
"name": "comment.block.proxpl",
40+
"begin": "/\\*",
41+
"end": "\\*/"
42+
}
43+
]
44+
},
45+
"keywords": {
46+
"patterns": [
47+
{
48+
"name": "keyword.control.proxpl",
49+
"match": "\\b(if|else|while|for|return|import)\\b"
50+
},
51+
{
52+
"name": "keyword.declaration.proxpl",
53+
"match": "\\b(var|func)\\b"
54+
}
55+
]
56+
},
57+
"types": {
58+
"patterns": [
59+
{
60+
"name": "storage.type.proxpl",
61+
"match": "\\b(int|float|string|bool)\\b"
62+
}
63+
]
64+
},
65+
"strings": {
66+
"patterns": [
67+
{
68+
"name": "string.quoted.double.proxpl",
69+
"begin": "\"",
70+
"end": "\"",
71+
"patterns": [
72+
{
73+
"name": "constant.character.escape.proxpl",
74+
"match": "\\\\."
75+
}
76+
]
77+
}
78+
]
79+
},
80+
"numbers": {
81+
"patterns": [
82+
{
83+
"name": "constant.numeric.proxpl",
84+
"match": "\\b[0-9]+(\\.[0-9]+)?\\b"
85+
}
86+
]
87+
},
88+
"booleans": {
89+
"patterns": [
90+
{
91+
"name": "constant.language.proxpl",
92+
"match": "\\b(true|false)\\b"
93+
}
94+
]
95+
},
96+
"operators": {
97+
"patterns": [
98+
{
99+
"name": "keyword.operator.proxpl",
100+
"match": "(\\+|\\-|\\*|\\/|==|!=|>|<|=)"
101+
}
102+
]
103+
},
104+
"functions": {
105+
"patterns": [
106+
{
107+
"name": "entity.name.function.proxpl",
108+
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"
109+
},
110+
{
111+
"name": "support.function.proxpl",
112+
"match": "\\b(print)\\b"
113+
}
114+
]
115+
}
116+
}
117+
}

0 commit comments

Comments
 (0)