company-lsp icon indicating copy to clipboard operation
company-lsp copied to clipboard

Company: backend company-lsp error "Wrong type argument: char-or-string-p, nil

Open netjune opened this issue 4 years ago • 1 comments

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)

netjune avatar Feb 21 '20 15:02 netjune

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).

netjune avatar Feb 22 '20 05:02 netjune