Open stardiviner opened 3 years ago
Running into the same problem.
The problem seems to be with lsp-completion--get-context
that is used as a parameter to the completion request. For whatever reason, lsp-completion--cache
gets set with an incomplete marker. The context sets specific :trigger-kind
in this case which seems to break the completions.
Unfortunately, just deactivating caching with (setq lsp-completion-no-cache 't)
doesn't seem to be enough, the :incomplete
marker is still set.
So the quick'n dirty hack that might very well break other things:
(defun sourcekit-lsp-completion-fix (method &rest args)
"Quick'n dirty fix for https://github.com/emacs-lsp/lsp-sourcekit/issues/18"
(when (and (eq major-mode 'swift-mode) (string-equal method "textDocument/completion"))
(message "%s" method)
(lsp-completion--clear-cache)))
(advice-add 'lsp-request :before 'sourcekit-lsp-completion-fix)
@rksm Hi, thanks for diving into the problem. I tried your method. Still have problem.
When lsp-sourcekit completing, got error Company: backend company-capf error "request cancelled" with args (candidates hel)
.
I enabled the lsp log, but have not got special output.
I guess current latest version company-capf
incompatible with lsp-sourcekit
or lsp-mode
.
https://github.com/emacs-lsp/lsp-mode/issues/3028
and
https://github.com/emacs-lsp/lsp-sourcekit/issues/20
seem to be related to this issue. i too had no luck clearing the cache or disabling it for company as company still would block containing the cancel error
@stardiviner have you found a workaround?
I still don't got a solution. sorry @wibed
https://github.com/emacs-lsp/lsp-mode/issues/2970
this issue with pr seems related to the problem
After overview this issue, seems still no good solution yet. Temporary typing code literally.
@stardiviner over at https://github.com/emacs-lsp/lsp-mode/issues/3028 the actual problem has been stated
Glad the patch pr will coming soon. Thanks for your effort on this issue. đŸ˜„
company-mode
displays error in minibuffer:Then I enabled lsp-mode debug with:
In buffer
*lsp-log: sourcekit-ls:55049*
: