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

Buffer is attached by ccls but lsp operations can not be performed #947

Open
hrcHarry opened this issue Aug 29, 2023 · 0 comments
Open

Buffer is attached by ccls but lsp operations can not be performed #947

hrcHarry opened this issue Aug 29, 2023 · 0 comments

Comments

@hrcHarry
Copy link

hrcHarry commented Aug 29, 2023

Hi

I use Bear (2.3.11) to generate compile_commands.json at the root directory and the lspconfig is set as follows (refering to ccls example on nvim-lspconfig and TJ's video)

local capabilities = require('cmp_nvim_lsp').default_capabilities()
local lspconfig = require'lspconfig'
lspconfig.ccls.setup {
  init_options = {
    compilationDatabaseDirectory = "build";
    index = {
      threads = 0;
    };
    clang = {
      excludeArgs = { "-frounding-math"} ;
    };
  },
  capabilities = capabilities,
  on_attach = function()
                print("LSP ccls is activated!")
                vim.keymap.set('n', 'K', vim.lsp.buf.hover, {desc = "Show description", buffer = 0})
                vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {desc = "Go to definition", buffer = 0})               
              end,
}

Observed behavior

When I open one of the .c file and inspect :LspInfo, it shows 1 client(s) attached to this buffer

However, when I tried to use gd to go definition, it doesn't work.
Moreover, I notice that the preprocessor that should comment out some block also does not work.

Expected behavior

Lsp operations can be active.

Steps to reproduce

Not sure how to reproduce.

System information

  • ccls version and clang version: ccls --version gives the result

  • OS: Ubuntu 18.04 on VirtualBox 7.0

  • Editor: Neovim v0.9.1

  • Language client (and version): ccls

Dose anyone has some idea? Or, is there something I miss?
If I lost some information, please let me know and I will edit it. Thanks.

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

1 participant