
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@sap/cds-lsp
Advanced tools
The CDS language server implements the Language Server Protocol (LSP) for SAP's Core Data Services (CDS). It can be used in many popular IDEs like, for example, Visual Studio Code, IntelliJ, or Eclipse. It provides many useful features for working with and enjoying CDS sources.
Syntax highlighting via Textmate grammar
Additional semantic highlighting
Source code validation providing diagnostics (error messages, warnings, ...)
Where-used navigation to
Code completion for
using
statementSnippets for typical CDS language construct
(with documentation extracts of capire explaining language concepts)
like
Quick fixes to
@description
annotations to doc commentsInventory (symbols) for
Hover information based on
@title
and @description
annotationsREADME.md
and package.json#description
Code formatting
;
or }
Code formatting via CLI (incl. verification mode)
Translation support
'{i18n>customerName}'
Annotation support via external plugin
The CDS language server can only be used as part of an IDE extension or plugin. See Installation for more details.
A code formatter for CDS source files is included.
Often, a plug-in or extension component for a specific language wraps the corresponding language server. For @sap/cds-lsp
there are specific extensions for
For other IDEs there exist generic client plug-ins for language servers. Examples:
@sap/cds-lsp
is a NodeJS module. As such it requires NodeJS installed on the client machine. Minimum version is 20.15.1
npm
cd
into itnpm i @sap/cds-lsp
to download the language server and all its dependenciesThis will create a sub-folder node_modules
with all required npm modules.
It will also create a platform specific shell script to start the language server.
It is located in the node_modules/.bin
sub-folder and is called cds-lsp
.
For a stdio connection use node_modules/.bin/cds-lsp --stdio
.
For other connection channels see below
install @sap/cds-lsp
from npmjs.org into subfolder cds-lsp
#!/bin/bash
componentName=cds-lsp
fullName="@sap/$componentName"
echo '=== Getting latest download URL'
url=$(npm view $fullName | sed -n 's/.tarball.*\(https.*\)$/\1/p')
echo "=== Downloading $url"
curl -O $url
filename=$(echo $url | sed -n 's/.*\/\(.*\)$/\1/p')
echo "=== Extracting $filename"
tar xfv $filename
mv package $componentName
echo "=== Removing $filename"
rm $filename
cd $componentName
echo "=== Installing dependencies"
npm i
start the server using stdio
#!/bin/bash
main=$(cat cds-lsp/package.json | sed -n 's/.*"main".*"\(.*\)".*/\1/p')
node "cds-lsp/$main" --stdio
Get the download URL for the tarball with npm view @sap/cds-lsp
. E.g.
/home/user$ npm view @sap/cds-lsp
@sap/cds-lsp@6.2.2 | SEE LICENSE IN LICENSE | deps: 9 | versions: 33
Language server for CDS
https://cap.cloud.sap/
keywords: CAP, CDS, LSP, SAP, language, editor
bin: cds-lsp, format-cds
dist
.tarball: https://registry.npmjs.org/@sap/cds-lsp/-/cds-lsp-6.2.2.tgz
...
Download the tarball e.g. curl -O https://registry.npmjs.org/@sap/cds-lsp/-/cds-lsp-6.2.2.tgz
Extract the TGZ file e.g. tar -xf cds-lsp-6.2.2.tgz
Enter package
folder: cd package
Execute npm i
to install the dependencies.
Check the main
entry in package.json
. This is the start script e.g.
/home/user/package$ grep "main" package.json
"main": "dist/main.js",
The simplest form to start the language server using stdio
(see Connection channels below) e.g.
/home/user/package$ node dist/main.js --stdio
The server is started and waits for a client to connect
@sap/cds-lsp
can communicate to a client via one of three different connection channels (see the documentation of the client plug-in for details which channels are supported)
stdio
: the language server listens on stdin
for requests and sends responses to stdout
node-ipc
(if the client runs with NodeJS): add --node-ipc
as a command-line argumentsockets
: add --socket=<port>
as a command-line argumentFor details see the similar json-language-server integration docs.
For performance reasons, syntax highlighting is not done via the language server protocol.
A TextMate grammar aside of the language server provides this.
@sap/cds-lsp
comes with a TextMate grammar file included for the CDS language.
Additionally @sap/cds-lsp
supports semantic highlighting. This is a feature of the language server protocol and is supported by some IDEs.
While specific client extensions usually integrate this by default, a generic integration requires to configure this separately.
Some IDEs have TextMate support built-in. Others require another plug-in, a TextMate client.
Refer to the corresponding documentation how to configure a custom TextMate grammar file. CDS source files have the .cds
file extension.
This package is provided under the terms of the SAP Developer License Agreement.
FAQs
Language server for CDS
The npm package @sap/cds-lsp receives a total of 903 weekly downloads. As such, @sap/cds-lsp popularity was classified as not popular.
We found that @sap/cds-lsp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.