Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cds-lsp #2926

Merged
merged 3 commits into from
Dec 10, 2023
Merged

feat: add cds-lsp #2926

merged 3 commits into from
Dec 10, 2023

Conversation

stijnme
Copy link
Contributor

@stijnme stijnme commented Dec 9, 2023

Basic LSP config for @sap/cds-lsp

@stijnme stijnme requested a review from glepnir as a code owner December 9, 2023 14:53
@glepnir glepnir merged commit 0cfac3b into neovim:master Dec 10, 2023
9 checks passed
@nbys
Copy link

nbys commented Jan 12, 2025

It might be due to my moderate experience with Neovim, but I struggled a bit to get this language server working. :LspInfo indicated that cds_lsp was not working for my CDS views files. I investigated the path, tried different versions of Node.js, and experimented with various configurations using lsp-config. However, the problem was much simpler: Neovim was not detecting the filetype cds.

You can check the filetype with :set ft?. If it works, it shows filetype=cds.

To fix this, I added these lines to my init.lua file. Now, cds_lsp is correctly attached:

vim.filetype.add({
    extension = {
        cds = "cds",
    },
})

@justinmk
Copy link
Member

justinmk commented Jan 13, 2025

To fix this, I added these lines to my init.lua file. Now, cds_lsp is correctly attached:

vim.filetype.add({
    extension = {
        cds = "cds",
    },
})

Because nvim/vim doesn't have "cds" filetype detection by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants