tigersoldier / company-lsp

Company completion backend for lsp-mode
GNU General Public License v3.0
251 stars 26 forks source link

[Java] Company: backend company-lsp error "Symbol’s function definition is void: s-matched-positions-all" #142

Closed arichiardi closed 4 years ago

arichiardi commented 4 years ago

Hi there!

I am trying this completion and it seems I am getting an error:

        s.charAt(${1:0})

The above is what I see in the buffer after I press enter and this is the error I am getting in the messages:

company-call-backend-raw: Company: backend company-lsp error "Symbol’s function definition is void: s-matched-positions-all" with args (post-completion charAt(int index) : char)

I don't think I understand much of what is going on there, any hint on how to debug? I am familiar with Elisp.

Stacktrace:

Debugger entered--Lisp error: (void-function s-matched-positions-all)
  s-matched-positions-all("{" "charAt(${1:0})")
  company-lsp--to-yasnippet-snippet("charAt(${1:0})")
  company-lsp--post-completion(#("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil)))))
  company-lsp(post-completion #("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil)))))
  apply(company-lsp (post-completion #("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil))))))
  company-call-backend-raw(post-completion #("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil)))))
  apply(company-call-backend-raw (post-completion #("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil))))))
  company--force-sync(company-call-backend-raw (post-completion #("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil))))) company-lsp)
  company-call-backend(post-completion #("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil)))))
  company-cancel(#("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil)))))
  company-finish(#("charAt(int index) : char" 0 24 (company-lsp-resolved t lsp-completion-item #<hash-table equal 8/8 0x158ddbeb6f19> lsp-completion-prefix #("cha" 0 3 (fontified nil)))))
  company-complete-selection()
  funcall-interactively(company-complete-selection)
  call-interactively(company-complete-selection nil nil)
  command-execute(company-complete-selection)

Thanks!

yyoncho commented 4 years ago

can you test with company-capf?

arichiardi commented 4 years ago

I have tried in ielm against my buffer and it seems that I receive the problem anyways:

ELISP> (s-matched-positions-all (regexp-quote "{") "charAt(${1:0})")
*** Eval error ***  Symbol’s function definition is void: s-matched-positions-all

Even after this:

ELISP> (require 's)
s
ELISP> s-matched-positions-all
*** Eval error ***  Symbol’s value as variable is void: s-matched-positions-all
ELISP> (s-matched-positions-all (regexp-quote "{") "charAt(${1:0})")
*** Eval error ***  Symbol’s function definition is void: s-matched-positions-all
arichiardi commented 4 years ago

It seems I have a rather old version of s lingering.

Thanks @yyoncho for your quick answer, closing this cause it has nothing to do with company-lsp.

Sorry for the noise!