1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/readme/dev/spec/server_debug.md

2.1 KiB

Debugging Server project with vscode

Using a debugger sometimes is much easier than trying to just print things to understand a bug, for the server project we have a configuration that makes it easy for everyone to run in debug mode inside vscode.

In the debug screen you can select "Server" and hit the play button to start the process.

image

Before running the server there is a task called transpile-server that runs yarn tsc to make sure that the latest changes in the package/server are being executed.

4f37e6073a/joplin.code-workspace (L360-L365)

In a optimal solution we would be doing this transpile-server task in the tasks.json file (inside the tasks.json we can use a type npm for the task that is more ergonomic)

If there are any new environment variables that need to be included before execution, there is a place where they can be added:

4f37e6073a/joplin.code-workspace (L387-L391)

Something that we could do to improve the experience is adding a build process to other projects that are used by the server project, but this still can be done with other terminals open.

Modifying the configuration:

To modify the configuration, for now, it is all in the joplin.code-workspace file, but if needed we could also break the configuration into two files, one for the launch.json and other for the tasks.json.

References:

vscode debugger

Launch option to vscode workspaces

vscode tasks

More images:

image image image