Skip to content

Commit

Permalink
feat: add cds-lsp (#2926)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
stijnme authored Dec 10, 2023
1 parent 511609a commit 0cfac3b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lua/lspconfig/server_configurations/cds_lsp.lua
Original file line number Diff line number Diff line change
@@ -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
```
]],
},
}

0 comments on commit 0cfac3b

Please sign in to comment.