-
-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathsample_vs_code_tasks.json
More file actions
134 lines (126 loc) · 5.25 KB
/
sample_vs_code_tasks.json
File metadata and controls
134 lines (126 loc) · 5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
Tasks definitions for compiling and running
Castle Game Engine projects in VS Code.
You can use this file for .vscode/tasks.json file in a workspace,
or as "User level tasks" (independent of workspace).
This tasks file allows to compile /run / compile+run the CGE project
associated with the currently open file.
Since it uses the currently open file,
it will work even with repositories that contain multiple CGE projects,
like https://github.com/castle-engine/castle-engine/
(which contains many examples and tools).
If your VS Code workspace is just a single CGE project,
then you can remove the line
"cwd": "${fileDirname}"
This way the tasks will just use CGE project in VS code workspace,
regardless of the currently open file.
See https://go.microsoft.com/fwlink/?LinkId=733558
for the documentation about the tasks.json format.
This file is distributed as public domain.
*/
{
"version": "2.0.0",
"tasks": [
// Compile and then Run the CGE project of the currently open editor file.
// This is like F9 in CGE editor.
{
"label": "(CGE) Compile And Run",
/* We use VS code "dependsOn" feature to run 2 tasks in a sequence.
This is better than using shell command with && which
is not universally supported by PowerShell. */
"dependsOn": [
"(CGE) Compile",
"(CGE) Run"
],
"dependsOrder": "sequence",
"group": {
"kind": "build",
"isDefault": true
}
},
// Compile the CGE project of the currently open editor file.
// This is like Ctrl + F9 in CGE editor.
{
"label": "(CGE) Compile",
"type": "shell",
/* Compile in debug mode using CGE build tool (calls FPC under the hood).
We pass -vb to make filenames obvious for problem matcher. */
"command": "castle-engine compile --mode=debug",
"options": {
/* Run in the directory of currently open editor file.
CGE build tool will automatically detect the CGE project,
looking for CastleEngineManifest.xml file in parents.
Alternatively: you can comment it out, then it will build assuming that
VS Code workspace corresponds to a CGE project (so CastleEngineManifest.xml
should be present in top-level of VS Code workspace). */
"cwd": "${fileDirname}"
},
"group": {
"kind": "build"
},
"problemMatcher": {
"fileLocation": "autoDetect",
//["autoDetect", "${workspaceFolder}"],
"pattern": [
{
/*
Match lines like
xxx.pas(123,456) Fatal: some message
Deliberately avoid matching summary line like
xxx.pas(2201) Fatal: There were 26 errors compiling module, stopping
Deliberately avoid
xxx.pas(648,15) Error: Found declaration: ...
because they only make sense when connected to previous error message, and VS Code reorders them.
Test: https://regex101.com/ (ECMAScript flavor)
*/
"regexp": "^([^\\(]+)\\(([\\d+,]+)\\)\\s+(Fatal|Warning|Error|Note|Hint):\\s+((?!\\(10026\\) There were)(?!There were)(?!Found declaration: )(?!\\(5088\\)Found declaration: ).*)$",
"file": 1,
// location may be line or line+column.
"location": 2,
"severity": 3,
"message": 4
}
/* ,
{
// Match lines like
// Compiling xxx.pas
"regexp": "^(Compiling) ([^\\s]+)$",
"file": 2,
"message": 1,
"kind": "file"
}
*/
],
/* We need non-empty owner to hide older problems on recompilation.
See https://github.com/Microsoft/vscode/issues/50448,
https://github.com/microsoft/vscode/issues/66982
*/
"owner": "cge"
}
},
// Run the CGE project of the currently open editor file.
// This is like Shift + F9 in CGE editor.
{
"label": "(CGE) Run",
"type": "shell",
"command": "castle-engine run --windows-robust-pipes --mode=debug",
"options": {
"cwd": "${fileDirname}"
},
"group": {
"kind": "build"
}
},
{
"label": "(CGE) Run (no sound)",
"type": "shell",
"command": "castle-engine run --windows-robust-pipes --mode=debug -- --no-sound",
"options": {
"cwd": "${fileDirname}"
},
"group": {
"kind": "build"
}
}
]
}