lsp-mode
                                
                                 lsp-mode copied to clipboard
                                
                                    lsp-mode copied to clipboard
                            
                            
                            
                        company-minimum-prefix-length isn't taken into account when backspacing
I  have (setq company-minimum-prefix-length 1). The company starts after I type one letter, but keep triggering after I delete the letter (it is slow to complete with zero length prefix). Any fix for that?
After typing one letter:
 After deleting that letter:
After deleting that letter:

Company without lsp-mode works well.
(use-package company-lsp
  :ensure t)
(push 'company-lsp company-backends)
Adding company-lsp fixed the issue but it is no longer supported. Any fix without using company-lsp?
Seems to happen when I use csharp lsp-mode.
I have (setq company-minimum-prefix-length 2) but it triggers after one character and keep triggering after delete.
 
 
                                    
                                    
                                    
                                
What's your lsp-mode version? Can you take io trace when this happens?
@kiennq FYI it reproduces with lsp-start-plain.el
Does it only happen with csharp language server?
@kiennq FYI it reproduces with lsp-start-plain.el
disregard that, I though that I am in another issue.
@kiennq So far I see this problem only in csharp. I tried again with lsp-start-plain.el and the behaviour is kind of improved. I think this happen when company-yasnippets is enabled. After I disable yasnippets, the candidates are more relevant but company-minimum-prefix-length is still not working (company triggered after typing 1 character even though company-minimum-prefix-length is 2).
I found out the problem, csharp language server is sending space as trigger character, that's why the automatic completion is triggered even if you type with 1 character (you or Emacs must have insert spaces before the current symbol).
Since space as trigger character is too invasive, I think we can help a new custom setting/defvar to specify the character that will be omitted from the trigger characters list.
@yyoncho  WDYT?
Same with https://github.com/merrickluo/lsp-tailwindcss/
Since tailwindcss language server is using space as trigger char as well, it would trigger completion even with 1 space
and with tons of tailwind css classes to complete, the typing becomes extremely slow
Some thing like this might help
(advice-add #'lsp-completion--looking-back-trigger-characterp
            :filter-args
            (lambda (r) (seq-remove (lambda (it) (equal it " ")) r))
            '((name . --filter-spaces)))
I see that happening in both Scala and Haskell and the workaround does not help.
I think I'm hitting the same behaviour with company and lsp:
Despite 'company-minimum-prefix-length' set to '3', completion happens even with 0 characters.