m-pilia / vim-ccls

Vim plugin for the ccls language server
MIT License
97 stars 7 forks source link

Question/feature: How to enable FixIts/code action with coc nvim and ccls?? #55

Closed poetaman closed 2 years ago

poetaman commented 2 years ago

How to enable FixIts/code action with coc nvim and ccls?? nmap <leader>qf <Plug>(coc-fix-current) does not work at the moment with ccls, it works with coc-clangd.

m-pilia commented 2 years ago

Hi @reportaman, sorry for the late reply.

FixIt/code actions are not related to this project (vim-ccls). The LSP client (coc.nvim in your case) directly interacts with ccls without involving vim-ccls. So, unfortunately, your problem is out of this project's scope. You should be able to get support in the issue trackers of either ccls or coc.nvim.

(Code actions work for me using ccls + coc.nvim and the mapping that you suggested, so there might be something else interfering in your setup. I would advise to seek for support in the projects I mentioned above.)

damnskippy commented 2 years ago

@m-pilia, if you wouldn't mind could you please share how you tested the code action using ccls + coc.nvim? If you have a sample error and the code action, I would like to try myself. If it's too much of a hassle, no need to bother. Thanks.

m-pilia commented 2 years ago

Sure. I tested on this minimal example:

int main(int argc, char** argv) {
  int abc = 3;
  abcd = 4;
  return 0;
}

Line 3 produces the FixIt use of undeclared identifier 'abcd'; did you mean 'abc'?.

damnskippy commented 2 years ago

Thank you.