company-lsp
company-lsp copied to clipboard
Company: backend company-lsp error "Wrong type argument: char-or-string-p, nil
I set company-lsp-cache-candidates to t.
For example, in a go-mode buffer, the content:
package "main"
main () {
ch|
}
Cursor is at the char '|' and there are completions with prefix "ch". After a command(yas-expand), "ch" becomes "<-".
package "main"
main () {
<-|
}
Now the completion prefix is nil. company-mode still call the backend with arg 'match. Then company-lsp gets the prefix. The prefix is nil which cause the error.
It runs the code:
(downcase nil)
It seems that whether the cache is enabled or not, the issue happens.
Now I think it is bug of company-mode. It only compares the current point with the saved one to decide whether to refresh candicates. In this case, the point doesn't change, but the prefix has changed (to nil).