Search

Using Visual Studio Code

Get started with local development using [Visual Studio Code][vscode].

Content

Install Visual Studio Code

Add CDS Editor

  1. Download the extension for Visual Studio Code.
    • Scroll down to find the CDS Language Support for Visual Studio Code section.
    • Download the vsix file to a local folder.
  2. 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 vscode-cds-....vsix file.

Running Services

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 cds init. For example, in the Debug view launch cds run with the green arrow button:

Debugging Services

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: