doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.18k stars 3.03k forks source link

Completion acting strangely under cc-mode #7047

Open joshualex opened 1 year ago

joshualex commented 1 year ago

I confirm that...

Expected behavior

I turn on lsp for cc mode using the following in init.el: (cc +lsp)

I also have company enabled under :completion

When running this configuration with clangd installed, opening a .c file and hitting something that ends with a colon (e.g. case 2:) I expect nothing to happen and no completion dropdown to appear

Current behavior

writing the above triggers the completion dropdown with irrelevant suggestions (e.g. comment-line).

Steps to reproduce

  1. Open emacs with doom and the above configuration (clangd installed, cc+lsp, company, yasnippet)
  2. Open a fresh C file
  3. write 2: in the file

System Information

https://pastebin.com/9sdNAz0n

joshualex commented 1 year ago

As far as I can understand this is not a bug in lsp-mode, as it doesn't reproduce in lsp-start-plain

innerout commented 1 year ago

This is not a bug in lsp-mode, as @joshualex says, the problem probably is that company mode is triggered, and because lsp does not find any relevant completions for : it suggests other entries that other backends return. I agree with the OP that this behavior is annoying though.