From 0cfac3b9960d3a603b887a463e22d931ec1898cd Mon Sep 17 00:00:00 2001 From: Stijn Mertens <33527882+stijnme@users.noreply.github.com> Date: Sun, 10 Dec 2023 03:15:00 +0100 Subject: [PATCH] feat: add cds-lsp (#2926) * feat: added @sap/cds-lsp * fix(cds-lsp): update root dir pattern * fix(cds-lsp): cleanup double configuraton of root_dir copied from csslsp example --- .../server_configurations/cds_lsp.lua | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lua/lspconfig/server_configurations/cds_lsp.lua diff --git a/lua/lspconfig/server_configurations/cds_lsp.lua b/lua/lspconfig/server_configurations/cds_lsp.lua new file mode 100644 index 0000000000..a04876fe5a --- /dev/null +++ b/lua/lspconfig/server_configurations/cds_lsp.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'package.json', + 'db', + 'srv', +} + +return { + default_config = { + cmd = { 'cds-lsp', '--stdio' }, + filetypes = { 'cds' }, + -- init_options = { provideFormatter = true }, -- needed to enable formatting capabilities + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + settings = { + cds = { validate = true }, + }, + }, + docs = { + description = [[ + +https://cap.cloud.sap/docs/ + +`cds-lsp` can be installed via `npm`: + +```sh +npm i -g @sap/cds-lsp +``` + +]], + }, +}