Skip to content

Commit 9408a75

Browse files
committed
update vscode documentation
1 parent 6c996e8 commit 9408a75

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed

howtousevscode.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms-vscode.cpptools-extension-pack
1111
ms-python.python
1212
```
1313

14-
## Configure CMake
14+
## Select build configuration
1515

1616
<video autoplay muted playsinline loop src="images/configure.mp4" type="video/mp4"></video>
1717

@@ -21,34 +21,27 @@ First on the bottom left corner, in the status bar, select the build type. Optio
2121
- conda debug
2222
- conda release
2323

24-
If you are using conda, please select one of the respective ones.
24+
If you are using conda please select one of the respective ones.
2525

26-
Then press `Ctrl + P` and in the panel write `task ` (don't forget the space after task!). Finally select `Cmake: configure`, and that's it!
27-
28-
You will have to do this when you select a new configutation never used before. If you now select `release` you will have to configure again. If you go back to `debug` it is already configured, you dont have to launch the task.
26+
Cmake should automatically configure the project with the selected configuration.
2927

3028
## First build
3129

3230
<video autoplay muted playsinline loop src="images/build.mp4" type="video/mp4"></video>
3331

34-
Press `Ctrl + P` and write `task ` again (don't forget the space!)
35-
36-
Select `Cmake: build`, and watch it go. Or don't, it takes a lot of time to do a fresh build.
32+
Press `Ctrl + Shift + B`, or click the build button with the cog icon in the status bar, or run the `CMake: build` task.
3733

38-
There's a much more convenient shortcut to launch a build: `Ctrl + Shift + B`.
34+
**NOTE:** The first build takes a while.
3935

40-
Note that if you change configuration in the step above you will have to build again.
36+
**NOTE:** If you change configuration (see step above) you will have to build again.
4137

4238
## Launching the built executable and debugging
4339

44-
<video autoplay muted playsinline loop src="images/launch_debug.mp4" type="video/mp4"></video>
45-
40+
<video autoplay muted playsinline loop src="images/debug.mp4" type="video/mp4"></video>
4641

47-
On the left panel go to the debug section and click the little green play button. Alternatively press `F5`. Every time you launch the executable a build is triggered, to ensure all the latest changes you made to the code are compiled in.
42+
On the left panel go to the debug section and click the little green play button. Alternatively press `F5`. Every time you launch the debugger a build is triggered, to ensure all the latest changes you made to the code are compiled in.
4843

49-
The first time VSCode will ask to select some options. Just stick to `[default]` (which is the only option) and `FreeCADMain`. Don't worry you won't have to select these again.
50-
51-
After that you should see freecad launching and the debugger attaching to the process. If an error pops up the python debugger failed to attach (there's 30 second timeout).
44+
You should see freecad launching and the debugger attaching to the process. If an error pops up the python debugger failed to attach (there's 30 second timeout).
5245
Close FreeCAD and try launching it again. If it still fails try increasing the timeout located in the file `.vscode/scripts/WaitForDebugpy.py`
5346

5447
To debug please refer to the [documentation](https://code.visualstudio.com/docs/editor/debugging#_debug-actions) or search for a tutorial online.
@@ -59,18 +52,18 @@ To debug please refer to the [documentation](https://code.visualstudio.com/docs/
5952

6053
**NOTE:** Don't use the restart button. It only restarts the selected debugger, which definitely is not what you want. Instead press the stop button (which stops both debuggers) and launch again.
6154

62-
**NOTE:** During the build process all the python files in the source tree get copied (yes simply copied) to the build directory. You need to place breakpoints in the files inside `build/` otherwise the debugger won't pick them up. This does not apply to cpp files, with those simply place the breakpoints inside the source tree `src/`.
63-
6455
## Running tests
6556

6657
<video autoplay muted playsinline loop src="images/testing.mp4" type="video/mp4"></video>
6758

6859
The IDE supports running FreeCAD tests as well. On the left panel go to the testing section and click the play button. A build takes place and then all the tests are run and results reported.
6960

70-
**NOTE:** This is much slower than running the `Tests_run` executable directly. The GIF above is sped up.
61+
**NOTE:** This is much slower than running the `Tests_run` executable directly. The video above is sped up.
7162

7263
**NOTE:** Only c++ tests are currently integrated. Python tests are run from the `Test workbench` or with the command `FreeCAD -t 0`.
7364

65+
Alternatively, there are two vscode tasks that can be used to run the cpp and python tests directly.
66+
7467
**NOTE:** The debug tests button does not currently work. More configuration is needed to get that to work.
7568

7669
## General features of VSCode

images/build.mp4

1.63 MB
Binary file not shown.

images/configure.mp4

-28.1 KB
Binary file not shown.

images/debug.mp4

4.24 MB
Binary file not shown.

images/launch_debug.mp4

-3.12 MB
Binary file not shown.

0 commit comments

Comments
 (0)