summaryrefslogtreecommitdiff
path: root/.vscode/vs-code-template.code-workspace.in
blob: 067f46faa9e2fd379425834a51884b2c1b6e5d95 (plain)
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
// *** vs-code.code-workspace.template is an autogenerated file created by configure.ac ***
// any changes to the vs-code.code-workspace.template file WILL BE OVERRIDDEN
// use the vs-code.code-workspace file (make vscode-ide-integration) for your own edits
{
	"extensions": {
		"recommendations": [
			"ms-vscode.cpptools"
		]
	},
	"folders": [
		{
			"name": "srcdir",
			"path": "@SRC_ROOT@"
		},
		{
			// BUILDDIR may be configured separate from SRCDIR
			"name": "builddir",
			"path": "@BUILDDIR@"
		},
	],
	"settings": {
		"search.exclude": {
			"/compile_commands.json": true,
			"/dictionaries/": true,
			"/helpcontent2/": true,
			"/icon-themes/": true,
			"/translations/": true
		},
		"files.watcherExclude": {
			"/dictionaries/": true,
			"/helpcontent2/": true,
			"/icon-themes/": true,
			"/translations/": true
		},
		"files.associations": {
			"*.patch.[0-9]": "diff"
		},
		"C_Cpp.default.compileCommands": "@BUILDDIR@/compile_commands.json",
		// only used if the file doesn't match anything in the compile_commands.json - aka externals
		// libxml includes just added as example/for reference
		"C_Cpp.default.includePath": [
			"@WORKDIR@/UnpackedTarball/**",
			"/usr/include/libxml2/"
		],
		"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
		"C_Cpp.default.cppStandard": "c++20",
		// point this to LibreOffice's version of clang-format 5.0.0,
		// otherwise clang-format from the plugin is used, and that
		// gives slightly different results
		"C_Cpp.clang_format_path": "/opt/lo/bin/clang-format",
		"editor.rulers": [
			100
		],
		// files in the repo should in general have a newline at end-of-file
		"files.insertFinalNewline": true,
		"editor.renderFinalNewline": "off",
		"gitlens.autolinks": [
			{
				"prefix": "tdf#",
				"url": "https://bugs.documentfoundation.org/show_bug.cgi?id=<num>"
			}
		],
		"terminal.integrated.profiles.windows": {
			"Cygwin": {
				"path": "@CYGWIN_BASH@",
				"args": [
					"--login"
				],
				// prevent changing to $(HOME)
				"env": {
					"CHERE_INVOKING": "1"
				}
			}
		},
		"terminal.integrated.defaultProfile.windows": "Cygwin"
	},
	"tasks": {
		"version": "2.0.0",
		"tasks": [
			{
				"label": "full make",
				"detail": "runs make in builddir to update everything",
				"type": "shell",
				"command": "make",
				"group": {
					"kind": "build",
					"isDefault": true
				},
				"options": {
					"cwd": "@BUILDDIR@"
				}
			},
			{
				"label": "create compile-commands.json",
				"detail": "runs make vim-ide-integration to create the compile-commands.json file",
				"type": "shell",
				"command": "make",
				"args": [
					"vim-ide-integration"
				],
				"group": "build",
				// doesn't really depend on full make, but doesn't hurt
				// updating the compile-commands is not needed all the time and also demonstrate
				// how to use dependencies in tasks…
				"dependsOn": [
					"full make"
				],
				"options": {
					"cwd": "@BUILDDIR@"
				},
				"problemMatcher": [] // don't ask when manually running the task
			},
			{
				"label": "remove profile-dir",
				"detail": "removes the temporary user-profile directory",
				"type": "shell",
				"command": "rm",
				"args": [
					"-rf",
					"@WORKDIR@/vs-code-temporary-user-profile"
				],
				"group": "none",
				"dependsOn": [
					"full make"
				],
				"options": {
					"cwd": "@BUILDDIR@"
				},
				"problemMatcher": []
			}
		]
	},
	"launch": {
		"configurations": [
			{
				"name": "run in debugger after make",
				"type": "cppdbg",
				"request": "launch",
				"program": "@INSTROOT@/program/soffice.bin",
				"args": [],
				"stopAtEntry": false,
				"cwd": "@BUILDDIR@",
				"environment": [
					{
						// added in disabled form for convenience/as an example
						// (proper name is just SAL_LOG),
						// see https://docs.libreoffice.org/sal/html/sal_log.html
						"name": "SAL_LOG_DISABLED",
						"value": "+INFO.ucb+WARN"
					}
				],
				"externalConsole": false,
				"linux": {
					"MIMode": "gdb",
					"miDebuggerPath": "gdb",
					"setupCommands": [
						{
							"description": "Enable pretty-printing for gdb",
							"text": "-enable-pretty-printing",
							"ignoreFailures": true
						},
						{
							"description": "Mark pretty-printers (in solenv/gdb) safe",
							"text": "add-auto-load-safe-path @SRC_ROOT@/solenv/gdb",
							"ignoreFailures": true
						},
						{
							"description": "Mark pretty-printers bootstrap (in instdir/program) safe",
							"text": "add-auto-load-safe-path @INSTROOT@",
							"ignoreFailures": true
						},
					]
				},
				"osx": {
					"program": "@INSTROOT@/MacOS/soffice",
					"MIMode": "lldb",
					"setupCommands": [
						{
							"description": "load helpers for lldb",
							"text": "command script import ${workspaceFolder:srcdir}/solenv/lldb/libreoffice/LO.py",
							"ignoreFailures": false
						}
					]
				},
				"windows": {
					"type": "cppvsdbg"
				},
				"preLaunchTask": "full make"
			},
			{
				// FIXME: not happy here when creating the profile while running in debugger
				// no problem passing the profile dir once it was launched outside debugger once,
				// but clearing out the user-profile dir needs to be triggered manually
				"name": "run in gdb with clear userprofile",
				//	"preLaunchTask": "remove profile-dir",
				"type": "cppdbg",
				"request": "launch",
				"program": "@INSTROOT@/program/soffice.bin",
				"args": [
					"-env:UserInstallation=file:///@WORKDIR@/vs-code-temporary-user-profile"
				],
				"stopAtEntry": false,
				"cwd": "@BUILDDIR@",
				"environment": [
					{
						"name": "SAL_LOG_DISABLED",
						"value": "+INFO.ucb+WARN"
					}
				],
				"externalConsole": false,
				"linux": {
					"MIMode": "gdb",
					"miDebuggerPath": "gdb",
					"setupCommands": [
						{
							"description": "Enable pretty-printing for gdb",
							"text": "-enable-pretty-printing",
							"ignoreFailures": true
						},
						{
							"description": "Mark pretty-printers (in solenv/gdb) safe",
							"text": "add-auto-load-safe-path @SRC_ROOT@/solenv/gdb",
							"ignoreFailures": true
						},
						{
							"description": "Mark pretty-printers bootstrap (in instdir/program) safe",
							"text": "add-auto-load-safe-path @INSTROOT@",
							"ignoreFailures": true
						},
					]
				},
				"osx": {
					"program": "@INSTROOT@/MacOS/soffice",
					"MIMode": "lldb",
					"setupCommands": [
						{
							"description": "load helpers for for lldb",
							"text": "command script import ${workspaceFolder:srcdir}/solenv/lldb/libreoffice/LO.py",
							"ignoreFailures": false
						}
					]
				},
				"windows": {
					"type": "cppvsdbg"
				}
			}
		],
		"compounds": []
	}
}