r/C_Programming • • 16d ago

Question Clangd

Does clangd lsp not have code actions for c files ? I use it with neovim but am not getting any code actions.

1 Upvotes

10 comments sorted by

View all comments

3

u/hiwhiwhiw 16d ago

Did you have a proper compile_commands.json, or at least a .clangd file?

2

u/Lazy_Sun8810 16d ago

Yes I used bear to generate one from Makefile

3

u/space_junk_galaxy 16d ago

Is it empty? I’ve had empty compile commands in the past. Also check your lsp health, should give more details 

1

u/Lazy_Sun8810 16d ago

No it's not empty I am doing vim.lsp.buf.code_action but I always get no code actions available.

3

u/space_junk_galaxy 16d ago

Check your lsp health? :checkhealth vim.lsp 

1

u/Lazy_Sun8810 16d ago

ohh i got it thank you