Using Visual Studio Code
Get started with local development using Visual Studio Code.
Install Visual Studio Code
- Install Visual Studio Code and launch it.
- Also install the
codeshell command (optional):
Add CDS Editor
- Download the extension for Visual Studio Code.
- Download the vsix file to a local folder.
- In VS Code…
- Display the extensions pane icon in the left bar (or menu View / Extensions).
- Click the three dots in the extension pane’s upper right corner.
- Select Install from VSIX… and choose the downloaded
To run services, just open the Integrated Terminal in VSCode and use one of the
cds serve variants, for example, use
cds watch to automatically react on changes.
Alternatively, you can use the pre-configured tasks or launch configurations you get when creating a project with
For example, in the Debug view launch cds run with the green arrow button:
You can add and stop at breakpoints in your service implementations. For example, add one to line 10 of our
srv/cat-service.js by clicking in the gutter as shown below:
… then send the …/Books request again to stop there.
Restarting the Server
Restart the server when you did changes to your code by in vscode using the debugger control panes restart button: