emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.72k stars 861 forks source link

Completions disappear after dot + symbol #4419

Closed Hi-Angel closed 2 months ago

Hi-Angel commented 2 months ago

Thank you for the bug report

Bug description

lsp-mode treats . specially for many languages, as in, it provides completions immediately even though company-minimum-prefix-length isn't satisfied. Which makes sense of course. Unfortunately, lsp-mode loses completion after typing out the next symbol, instead of reducing them to ones that start with the symbol.

So e.g. foo. pops up completions, but foo.c kills the pop up even if there are candidates.

Also asked as a question here: https://emacs.stackexchange.com/questions/80977/prevent-lsp-company-from-losing-completion-after-dot-symbol

Side note: elgot, the competitor mode, handles that correctly.

Steps to reproduce

  1. Create /tmp/.emacs as follows:

    (package-initialize)
    (use-package company)
    (use-package lsp)
  2. Start emacs as emacs -Q -l /tmp/.emacs test.py

  3. Execute M-x lsp

  4. Type "".

    A completion should appear

  5. Type c to reduce completions to ones starting with that letter

Expected behavior

Completions get reduced to ones starting with c, i.e. capitalize(), casefold(), etc.

Which Language Server did you use?

lsp-python, lsp-go, clangd.

OS

Linux

Error callstack

No response

Anything else?

No response

jcs090218 commented 2 months ago

I'm using my own company-fuzzy, so I don't have this issue. Let me ping one of the maintainers.

cc @kiennq