Skip to content

Commit 61243bb

Browse files
authored
Merge pull request #3 from cortex-command-community/development
Language Snippets, fixes to Language Configuration and Grammar
2 parents 021e3b6 + 83da952 commit 61243bb

File tree

9 files changed

+195
-22
lines changed

9 files changed

+195
-22
lines changed

.releaserc.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
[
2626
"@semantic-release/git",
2727
{
28-
"assets": [
29-
"package.json",
30-
"CHANGELOG.md",
31-
"syntaxes/ccini.tmLanguage.json"
32-
]
28+
"assets": ["package.json", "CHANGELOG.md"]
3329
}
3430
],
3531
[

.vscode/launch.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"request": "launch",
88
"name": "Launch Client",
99
"runtimeExecutable": "${execPath}",
10-
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceRoot}",
12+
"--disableExtension=cortex-command-community-project-language-support"
13+
],
1114
"outFiles": ["${workspaceRoot}/dist/client/out/**/*.js"],
1215
"autoAttachChildProcesses": true,
1316
"preLaunchTask": "watch"

.vscodeignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
*
22
**/*
33

4-
!node_modules/vscode-languageserver-types
5-
!node_modules/vscode-languageserver-textdocument
64
!dist
75
!docs
86
!CHANGELOG.md

package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
"contributes": {
2929
"configuration": {
3030
"type": "object",
31-
"title": "Example configuration",
31+
"title": "Cortex Command INI Language Options",
3232
"properties": {
33-
"languageServerExample.maxNumberOfProblems": {
33+
"cortex-command-community-project-language-support.maxNumberOfProblems": {
3434
"scope": "resource",
3535
"type": "number",
3636
"default": 100,
3737
"description": "Controls the maximum number of problems produced by the server."
3838
},
39-
"languageServerExample.trace.server": {
39+
"cortex-command-community-project-language-support.trace.server": {
4040
"scope": "window",
4141
"type": "string",
4242
"enum": [
@@ -47,7 +47,7 @@
4747
"default": "verbose",
4848
"description": "Traces the communication between VS Code and the language server."
4949
},
50-
"languageServerExample.gameDirectoryPath": {
50+
"cortex-command-community-project-language-support.gameDirectoryPath": {
5151
"scope": "resource",
5252
"type": "string",
5353
"default": ".",
@@ -66,7 +66,7 @@
6666
"extensions": [
6767
".ini"
6868
],
69-
"configuration": "packages/syntaxes/src/language-configuration.json"
69+
"configuration": "dist/packages/syntaxes/language-configuration.json"
7070
}
7171
],
7272
"grammars": [
@@ -75,6 +75,12 @@
7575
"scopeName": "source.ccini",
7676
"path": "dist/packages/syntaxes/ccini.tmLanguage.json"
7777
}
78+
],
79+
"snippets": [
80+
{
81+
"language": "ccini",
82+
"path": "dist/packages/syntaxes/snippets.json"
83+
}
7884
]
7985
},
8086
"devDependencies": {

packages/syntaxes/project.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8-
"command": "npx js-yaml packages/syntaxes/src/ccini.tmLanguage.yaml > dist/packages/syntaxes/ccini.tmLanguage.json",
9-
"outputs": ["{options.outputPath}"],
10-
"defaultConfiguration": "development",
8+
"executor": "nx:run-commands",
119
"options": {
12-
"outputPath": "dist/packages/syntaxes",
13-
"tsConfig": "packages/syntaxes/tsconfig.lib.json"
10+
"commands": [
11+
"npx mkdirp \"dist/packages/syntaxes\"",
12+
"npx js-yaml packages/syntaxes/src/ccini.tmLanguage.yaml > dist/packages/syntaxes/ccini.tmLanguage.json",
13+
"cp packages/syntaxes/src/snippets.jsonc dist/packages/syntaxes/snippets.json",
14+
"cp packages/syntaxes/src/language-configuration.json dist/packages/syntaxes/language-configuration.json"
15+
],
16+
"outputPath": "dist/packages/syntaxes"
1417
},
18+
"outputs": ["{options.outputPath}"],
19+
"defaultConfiguration": "production",
1520
"configurations": {
16-
"development": {},
1721
"production": {}
1822
}
1923
}

packages/syntaxes/src/ccini.tmLanguage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repository:
2626
definitions:
2727
name: meta.definition.block
2828
begin: ^((\w+)\s+(=)\s+(?:(.+?)(?:\s*?))(?=(?:\/\*(?!.*\*\/))|\/\/|\n))
29-
end: ^(?!\t+)
29+
end: ^(?=\w)
3030
beginCaptures:
3131
'0':
3232
name: meta.expression.assignment

packages/syntaxes/src/snippets.jsonc

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
// Place your snippets for ccini here. Each snippet is defined under a snippet name and has a prefix, body and
3+
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
4+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
5+
// same ids are connected.
6+
// Example:
7+
// "Print to console": {
8+
// "prefix": "log",
9+
// "body": [
10+
// "console.log('$1');",
11+
// "$2"
12+
// ],
13+
// "description": "Log output to console"
14+
// }
15+
16+
"Vector": {
17+
"prefix": "Vector",
18+
"body": ["Vector", "\tX = ${1:0}", "\tY = ${2:0}", "$0"]
19+
},
20+
21+
"ContentFile": {
22+
"prefix": "ContentFile",
23+
"body": ["ContentFile", "\tFilePath = $1", "$0"]
24+
},
25+
26+
"Color": {
27+
"prefix": "Color",
28+
"body": ["Color", "\tR = ${1:0}", "\tG = ${2:0}", "\tB = ${3:0}", "$0"]
29+
},
30+
31+
"Box": {
32+
"prefix": "Box",
33+
"body": [
34+
"Box",
35+
"\tCorner = Vector",
36+
"\t\tX = ${1:0}",
37+
"\t\tY = ${2:0}",
38+
"\tWidth = ${3:0}",
39+
"\tHeight = ${4:0}",
40+
"$0"
41+
]
42+
},
43+
44+
"Area": {
45+
"prefix": "Area",
46+
"body": [
47+
"Area",
48+
"\tName = $1",
49+
"\tAddBox = Box",
50+
"\t\tCorner = Vector",
51+
"\t\t\tX = ${2:0}",
52+
"\t\t\tY = ${3:0}",
53+
"\t\tWidth = ${4:0}",
54+
"\t\tHeight = ${5:0}",
55+
"$0"
56+
]
57+
},
58+
59+
"GlobalScript": {
60+
"prefix": "GlobalScript",
61+
"body": [
62+
"GlobalScript",
63+
"\tPresetName = ${1}",
64+
"\tDescription = ${2}",
65+
"\tScriptPath = ${3}",
66+
"\tLuaClassName = ${4}",
67+
"$0"
68+
]
69+
},
70+
71+
"Exit": {
72+
"prefix": "Exit",
73+
"body": [
74+
"Exit",
75+
"\tOffset = Vector",
76+
"\t\tX = ${2:0}",
77+
"\t\tY = ${3:0}",
78+
"\tVelocity = Vector",
79+
"\t\tX = ${2:0}",
80+
"\t\tY = ${3:0}",
81+
"\tRadius = ${4:10}",
82+
"\tRange = ${5:35}",
83+
"$0"
84+
]
85+
}
86+
}

tests/Benchmark.ini

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ AddScene = Scene
2323
CopyOf = Base.rte/Default Middle
2424
AddBackgroundLayer = SLBackground
2525
CopyOf = Base.rte/Clouds Layer A
26+
2627
AddBackgroundLayer = SLBackground
2728
CopyOf = Base.rte/Default Sky Layer
2829
AddArea = Area
@@ -32,4 +33,42 @@ AddScene = Scene
3233
Y = 20
3334
Width = 1002
3435
Height = 60
35-
Name = Benchmark
36+
Name = Benchmark s
37+
38+
AddScene = Scene
39+
PresetName = Benchmark
40+
Description = Scene for benchmarking.
41+
LocationOnPlanet = Vector
42+
X = 167
43+
Y = -7
44+
MetagamePlayable = 0
45+
Revealed = 0
46+
Terrain = SLTerrain
47+
PresetName = Benchmark Terrain
48+
BitmapFile = ContentFile
49+
FilePath = Benchmark.rte/Benchmark.png
50+
WrapX = 1
51+
WrapY = 0
52+
BackgroundTexture = ContentFile
53+
FilePath = Base.rte/Scenes/Textures/DirtDark.png
54+
GlobalAcceleration = Vector
55+
X = 0
56+
Y = 20
57+
AddBackgroundLayer = SLBackground
58+
CopyOf = Base.rte/Default Front
59+
AddBackgroundLayer = SLBackground
60+
CopyOf = Base.rte/Default Middle
61+
AddBackgroundLayer = SLBackground
62+
CopyOf = Base.rte/Clouds Layer A
63+
64+
AddBackgroundLayer = SLBackground
65+
CopyOf = Base.rte/Default Sky Layer
66+
AddArea = Area
67+
AddBox = Box
68+
Corner = Vector
69+
X = 0
70+
Y = 20
71+
Width = 1002
72+
Height = 60
73+
Name = Benchmark s
74+

tests/Index.ini

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,45 @@ DataModule
44
IncludeFile = Benchmark.rte/Effects.ini
55
IncludeFile = Benchmark.rte/Benchmark.ini
66
IncludeFile = Benchmark.rte/Mission Activities.ini
7-
ALLCAPS
7+
Test = Vector
8+
X = 1
9+
Y = 3
10+
Test = ContentFile
11+
FilePath = test
12+
Test = Color
13+
R = 4
14+
G = -2
15+
B = 3
16+
Test = Box
17+
Corner = Vector
18+
X = 9
19+
Y = 2
20+
Width = 1
21+
Height = 2
22+
Test = Area
23+
Name = peep
24+
AddBox = Box
25+
Corner = Vector
26+
X = 0
27+
Y = 0
28+
Width = 0
29+
Height = 0
30+
Test = GlobalScript
31+
PresetName = peppp
32+
Description = rprpp
33+
ScriptPath = Base.rte/rrr.png
34+
LuaClassName = penis
35+
Test = Exit
36+
Offset = Vector
37+
X = 0
38+
Y = 0
39+
Velocity = Vector
40+
X = 0
41+
Y = 0
42+
Radius = 10
43+
Range = 35 /*
44+
45+
46+
47+
48+

0 commit comments

Comments
 (0)