generated from athackst/vscode_ros2_workspace
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sailbot.code-workspace
528 lines (518 loc) · 18.1 KB
/
sailbot.code-workspace
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
{
"folders": [
{
"path": "."
},
{
"path": "src/boat_simulator"
},
{
"path": "src/controller"
},
{
"path": "src/custom_interfaces"
},
{
"path": "src/diagnostics"
},
{
"path": "src/global_launch"
},
{
"path": "src/integration_tests"
},
{
"path": "src/local_pathfinding"
},
{
"path": "src/network_systems"
},
{
"path": "src/website"
},
],
"settings": {
// general
"cSpell.enabled": true,
"cSpell.allowCompoundWords": true,
"cSpell.ignorePaths": [
"package-lock.json",
"node_modules",
"vscode-extension",
".git/objects",
".vscode",
".vscode-insiders",
".devcontainer/devcontainer.json"
],
"cSpell.words": [
"athackst",
"autopep",
"bsoncxx",
"buildx",
"Clangd",
"cmake",
"completionist",
"conda",
"cout",
"cppcheck",
"cppdbg",
"cpplint",
"DCMAKE",
"deque",
"devcontainer",
"dtype",
"endl",
"gaurav",
"gtest",
"ighxy",
"ints",
"iostream",
"isort",
"kmph",
"mkdocs",
"mongocxx",
"mypy",
"noqa",
"OMPL",
"pallete",
"Protobuf",
"protofiles",
"pytest",
"Raye",
"rclcpp",
"rclpy",
"rcutils",
"repos",
"roscd",
"rosdep",
"rosdistro",
"rosidl",
"roslaunch",
"rosrun",
"RTPS",
"srcnew",
"srcraye",
"struct",
"Structs",
"ubcsailbot",
"uncrustify",
"virtualenv",
"Wextra",
"Wpedantic",
"xcalc",
"xhost",
"xinit",
"xinitrc",
"xmllint",
"xorg"
],
"editor.inlayHints.enabled": "off",
"editor.renderWhitespace": "trailing",
"editor.tabSize": 4,
"files.associations": {
"*.repos": "yaml",
"*.world": "xml",
"*.xacro": "xml"
},
"files.exclude": {
// VSCode defaults
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
// c_cpp_properties.json is autogenerated by the micrsoft c/c++ extension for intellisense.
// We explicitly disable its intellisense in favor of clangd's intellisense, but it still auto generates.
// Do not exclude the entire .vscode folder, as we may want to use the extension's debugger, which requires
// a .vscode/launch.json file
"**/.vscode/c_cpp_properties.json": true
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"search.exclude": {
"**/build": true,
"**/install": true,
"**/log": true
},
"todo-tree.highlights.useColourScheme": true,
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#19488d",
"activityBar.activeBorder": "#dd4181",
"activityBar.background": "#19488d",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#dd4181",
"activityBarBadge.foreground": "#e7e7e7",
"sash.hoverBorder": "#19488d",
"statusBar.background": "#113262",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#19488d",
"statusBarItem.remoteBackground": "#113262",
"statusBarItem.remoteForeground": "#e7e7e7",
"titleBar.activeBackground": "#113262",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#11326299",
"titleBar.inactiveForeground": "#e7e7e799",
"commandCenter.border": "#e7e7e799"
},
// python
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.rulers": [99],
},
"notebook.formatOnCellExecution": true,
"notebook.formatOnSave.enabled": true,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.extraPaths": [
"/workspaces/sailbot_workspace/install/lib/python3.10/site-packages",
"/opt/ros/humble/lib/python3.10/site-packages"
],
"python.analysis.include": ["${workspaceFolder:sailbot_workspace}/src"],
"python.analysis.exclude": ["${workspaceFolder:sailbot_workspace}/src/virtual_iridium"],
// Autocomplete from ros python packages
"python.autoComplete.extraPaths": [
"/workspaces/sailbot_workspace/install/lib/python3.10/site-packages",
"/opt/ros/humble/lib/python3.10/site-packages"
],
"python.defaultInterpreterPath": "/usr/bin/python3",
// Environment file lets vscode find python files within workspace
"python.envFile": "/workspaces/sailbot_workspace/.env",
// linter: flake8 extension
// copy from https://github.com/ament/ament_lint/blob/humble/ament_flake8/ament_flake8/configuration/ament_flake8.ini
// except for import order style = google: use isort with black profile instead
"flake8.args": [
"--config=${workspaceFolder:sailbot_workspace}/.flake8",
],
"flake8.interpreter": ["/usr/bin/python3"],
// formatter: black and isort extensions
"black-formatter.interpreter": ["/usr/bin/python3"],
"black-formatter.args": [
"--line-length=99",
],
"isort.args":["--profile=black"],
"isort.interpreter": ["/usr/bin/python3"],
// test framework: pytest
"python.testing.cwd": "/workspaces/sailbot_workspace/src",
"python.testing.pytestEnabled": true,
// type checker: mypy
"mypy-type-checker.args": [
"--ignore-missing-imports",
],
"mypy-type-checker.interpreter": ["/usr/bin/python3"],
// c/c++
"C_Cpp.intelliSenseEngine": "disabled", // Use clangd intellisense instead (it's better)
"clangd.path": "/usr/bin/clangd",
"clangd.onConfigChanged": "restart",
"clangd.arguments": [
"-log=verbose",
"-pretty",
"--background-index",
"--compile-commands-dir=/workspaces/sailbot_workspace/build/",
"--header-insertion=never"
],
"[cpp]": {
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
"editor.formatOnSave": true,
"editor.rulers": [120],
},
"[c]": {
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
"editor.formatOnSave": true,
"editor.rulers": [120],
},
"testMate.cpp.discovery.loadOnStartup": true,
// The following setting just changes the default prelaunch task from "build" to "debug"
"testMate.cpp.test.advancedExecutables": [
{
"pattern": "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*",
"runTask": {
"before": [ "debug" ]
}
}
],
// markdown
// copied from docs: https://github.com/UBCSailbot/docs/blob/main/.vscode/settings.json
"[markdown]": {
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.wordWrap": "on",
"editor.quickSuggestions": {
"other": "off",
"comments": "off",
"strings": "off"
},
"editor.rulers": [120],
"editor.renderWhitespace": "trailing",
"cSpell.fixSpellingWithRenameProvider": true,
"cSpell.advanced.feature.useReferenceProviderWithRename": true,
"cSpell.advanced.feature.useReferenceProviderRemove": "/^#+\\s/"
},
// yaml
"yaml.schemas": {
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
},
"yaml.customTags": [
"!ENV scalar",
"!ENV sequence",
"!relative scalar",
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format"
],
// PlantUML diagrams extension
"plantuml.exportFormat": "png",
"plantuml.exportIncludeFolderHeirarchy": false,
"plantuml.exportOutDir": "diagrams/out",
"plantuml.exportSubFolder": false,
},
"launch": {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ROS: Run Launch File",
"type": "ros",
"request": "launch",
"preLaunchTask": "Build All",
"target": "${workspaceFolder:sailbot_workspace}/install/share/${input:launchFile}",
},
{
"name": "ROS: Attach Process (currently only C++ working)",
"type": "ros",
"request": "attach"
},
{
"name": "Python Debugger: Attach Process",
"type": "debugpy",
"request": "attach",
"processId": "${command:pickProcess}",
},
// Can't launch ros nodes standalone because ros parameters aren't initialized
{
"name": "Python Debugger: Run Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
},
{
"name": "C++ (GDB): Run Node",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder:sailbot_workspace}/install/lib/${input:node}",
"args": [],
// Have testMate extension build before starting debug session to avoid building twice
// "preLaunchTask": "debug",
"stopAtEntry": false,
"cwd": "${workspaceFolder:sailbot_workspace}",
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
],
"inputs": [
{
"id": "launchFile",
"type": "pickString",
"description": "Launch file to run, in the format `<package>/<launch file>`",
"options": [
"../../src/global_launch/main_launch.py",
"boat_simulator/main_launch.py",
"local_pathfinding/main_launch.py",
"network_systems/launch/main_launch.py",
]
},
{
"id": "node",
"type": "pickString",
"description": "Node to run, in the format `<package>/<node>`",
"options": [
"network_systems/can_transceiver",
"network_systems/example",
"network_systems/local_transceiver",
],
"default": "network_systems/local_transceiver"
}
]
},
"tasks": {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
// Build tasks
{
"label": "Build All",
"detail": "Build all packages in the workspace",
"type": "shell",
"command": "${workspaceFolder:sailbot_workspace}/scripts/build.sh",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$gcc"
},
{
"label": "Build Package",
"detail": "Build a specific package in the workspace",
"type": "shell",
"command": "${workspaceFolder:sailbot_workspace}/scripts/build.sh -p ${input:package}",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$gcc"
},
{
"label": "debug",
"detail": "Build workspace (debug)",
"type": "shell",
"command": "${workspaceFolder:sailbot_workspace}/scripts/build.sh Debug",
"group": "build",
"problemMatcher": "$gcc"
},
// Test tasks
{
"label": "test",
"detail": "Run all unit tests and show results.",
"type": "shell",
"command": "${workspaceFolder:sailbot_workspace}/scripts/test.sh",
"group": {
"kind": "test",
"isDefault": true
}
},
// Clean
{
"label": "clean",
"detail": "Run the clean target",
"type": "shell",
"command": "colcon build --packages-ignore virtual_iridium --merge-install --cmake-target clean",
"problemMatcher": "$gcc"
},
{
"label": "purge",
"detail": "Purge workspace by deleting all generated files.",
"type": "shell",
"command": "sudo rm -rf build install log; py3clean .",
"problemMatcher": []
},
// Linting and static code analysis tasks
{
"label": "lint_cmake",
"detail": "Run lint on cmake files.",
"type": "shell",
"command": "LINTER=lint_cmake LOCAL_RUN=true scripts/ament-lint.sh",
"problemMatcher": [
"$ament_lint_cmake"
],
"presentation": {
"panel": "dedicated",
"clear": true
}
},
{
"label": "clang-tidy",
"detail": "Run clang-tidy static analysis",
"type": "shell",
"command": "LOCAL_RUN=true scripts/clang-tidy.sh",
"problemMatcher": [],
"presentation": {
"panel": "dedicated",
"clear": true
}
},
{
"label": "flake8",
"detail": "Run flake8 on python files.",
"type": "shell",
"command": "LINTER=flake8 LOCAL_RUN=true scripts/ament-lint.sh",
"problemMatcher": [
"$ament_flake8"
],
"presentation": {
"panel": "dedicated",
"clear": true
}
},
{
"label": "mypy",
"detail": "Run mypy on python files.",
"type": "shell",
"command": "LINTER=mypy LOCAL_RUN=true scripts/ament-lint.sh",
"problemMatcher": [
"$ament_mypy",
],
"presentation": {
"panel": "dedicated",
"clear": true
}
},
{
"label": "xmllint",
"detail": "Run xmllint on xml files.",
"type": "shell",
"command": "LINTER=xmllint LOCAL_RUN=true scripts/ament-lint.sh",
"problemMatcher": [
"$ament_xmllint",
],
"presentation": {
"panel": "dedicated",
"clear": true
}
},
{
"label": "ament lint",
"detail": "Run all ament linters.",
"dependsOn": [
"lint_cmake",
"flake8",
"mypy",
"xmllint",
],
"problemMatcher": []
},
// Workspace editing tasks
{
"label": "setup",
"detail": "Set up the workspace",
"type": "shell",
"command": "./scripts/setup.sh",
"problemMatcher": []
}
],
"inputs": [
{
"id": "package",
"type": "pickString",
"description": "Package to select",
"options": [
"boat_simulator",
"controller",
"custom_interfaces",
"global_launch",
"integration_tests",
"local_pathfinding",
"network_systems",
]
},
]
}
}