Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions developer/setup/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You will first need to <a href="https://revbayes.github.io/compile-windows">inst

Now you will need to install three extensions to get RevBayes to work nicely. To do this click on the button shown below in VSCode.

<img src="figures/Extension-button.png">
<img src="figures/Extension-button.png" alt="Location of Extension button in VSCode">

Getting RevBayes working
------------------------
Expand All @@ -22,4 +22,18 @@ Now that these are installed, CMake tools will prompt in the lower right asking

Once the CMake build finishes, you can setup debugging by clicking the triangle with the small beatle in the lower left. Now click on the gear shown below. This will open a new file called `launch.json`. You need to change the values for the `"program:"` object to the path where your `rb` executeable is. For example, `"${workspaceFolder}/build/rb"`. In VSCode `${workspaceFolder}` refers to the root folder of the project you opened (unless you have changed the folder's name, this is most likely `revbayes`). To test a specific rev script, change the value of the `"args"` object to a location of a Rev script. With that you can use debugging in VSCode by pressing the play button on the debug panel, or using the command palette (Ctrl+Shift+P or CMD+Shift+P) and using the "CMake: Debug" command. VSCode will then run the file you added to `"args"`, but stop the process whenever it reaches a line you have set with a breakpoint (i.e. where you have clicked to the left of the line number, adding a small red dot). When stopped at a breakpoint, you can use the debugging panels to investigate variables and functions to debug your program.

<img src="figures/screensho2.png">
<img src="figures/screensho2.png" alt="Location of Debug command in VSCode">

If you encounter the error `BOOST_ROOT not set`, create a file `.vscode/settings.json` with the content

```json
{
"cmake.environment": {
"BOOST_ROOT": "C:/Program Files/Boost/boost_1_86_0",
"BOOST_LIBRARYDIR": "C:/Program Files/Boost/boost_1_86_0/lib"
}
}
```

Update each path to match the location of your own Boost installation.