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

CCLS #308

Open
TheFloatingBrain opened this issue Aug 25, 2023 · 5 comments
Open

CCLS #308

TheFloatingBrain opened this issue Aug 25, 2023 · 5 comments

Comments

@TheFloatingBrain
Copy link

TheFloatingBrain commented Aug 25, 2023

CCLS is a C/C++/Objective-C language server that can be used with lsp-config (which I understand that lsp-zero is built using). If I run LspInstall it only gives me clangd (when though there are other C++ language servers/related things (formatters/linters) available on Mason (clang-format, codelldb, cpplint, cpptools soralint-language-server) tagged as being C++ servers, but they dont show up in the list. If I try to use lsp.setup_servers({'ccls', force = true}) nothing seems to happen. I wanted to know: since lsp-zero builds on lsp-config, is there a work-around to get it to support CCLS? In addition, could CCLS be added?

@VonHeikemen
Copy link
Owner

If is not avaible in mason.nvim then you will have to install it manually. Then just use lspconfig like they show on the wiki.

@TheFloatingBrain
Copy link
Author

I tried a slight variation on the default config:

local lspconfig = require('lspconfig')
lspconfig.ccls.setup {
  init_options = {
    compilationDatabaseDirectory = "build";
    cache = {
      directory = ".ccls-cache";
    };
  }
}

Seems to work, but no auto complete, it is saying that it cant find the nvim-cmp module.

@VonHeikemen
Copy link
Owner

Does autocomplete work with any other language server?

@TheFloatingBrain
Copy link
Author

TheFloatingBrain commented Sep 1, 2023

Yes, I got it to work with python-language-server with the config I was trying commented out. If I uncomment it however, it does tell me it cant find cmp or nvim-cmp if I try to use the code at the top of this. Not sure if I need it though, if I delete that code from init.lua autocomplete for python works fine. However I am not sure if I need this more advanced completion for CCLS

@VonHeikemen
Copy link
Owner

So it seems you don't have nvim-cmp installed, or is not loading correctly. So whatever completions you do have working they are not configured by lsp-zero.

If you don't need nvim-cmp, you can delete the code that uses the cmp module from your config.

If you want lsp-zero to handle the autocomplete configuration, make sure you have all these plugins installed:

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

No branches or pull requests

2 participants