@sap/cds-lsp
TypeScript icon, indicating that this package has built-in type declarations

7.8.2 • Public • Published

CDS Language Server

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 or Eclipse. It provides many useful features for working with and enjoying CDS sources.

Features

  • Syntax highlighting via Textmate grammar

  • Additional semantic highlighting

  • Source code validation providing diagnostics (error messages, warnings, ...)

  • Where-used navigation to

    • definition
    • references
    • highlight occurrences
  • Code completion for

    • keywords
    • identifiers incl. not yet imported identifiers with corresponding using statement
    • using paths and artifacts incl. showing README.md documentation as details
    • i18n translation IDs
    • turn on/off formatting regions
  • Snippets for typical CDS language construct
    (with documentation extracts of capire explaining language concepts)
    like

    • namespace and context
    • using
    • service
    • type
    • entity and projections, ...
    • element, associations, and compositions
    • extend and annotate
    • annotations for documentation
  • Quick fixes to

    • create using statement for unknown artifacts
    • maintain missing translation
    • convert @cds.doc and @description annotations to doc comments
  • Inventory (symbols) for

    • current file
    • workspace incl. query capabilities to select, for example, artifact types, names, also include reuse models
  • Hover information based on

    • doc comments
    • @title and @description annotations
    • translations
  • Code formatting

    • whole document
    • selected range
    • on-the-fly when completing statements using ; or }
    • on save (depending on the IDE)
    • on paste (depending on the IDE)
    • with many options, configurable using
      • settings file
      • command line switches
      • Config UI with simulation of options for Visual Studio Code and Eclipse
      • JSON schema for textual support
    • also for markdown in doc comments
  • Code formatting via CLI

  • Translation support

    • properties, JSON, and CSV files
    • navigate to translation definitions from translation IDs like '{i18n>customerName}'
    • show translations on hover
    • quickfix to maintain missing translations
  • Plugin framework for external handlers of annotation domains

Usage

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.

Installation

Refer to the installation details.

License

This package is provided under the terms of the SAP Developer License Agreement.

Package Sidebar

Install

npm i @sap/cds-lsp

Weekly Downloads

1,290

Version

7.8.2

License

SEE LICENSE IN LICENSE

Unpacked Size

1.61 MB

Total Files

29

Last publish

Collaborators

  • sap_extncrepos