Closed yyoncho closed 4 years ago
Ivan Yonchovski notifications@github.com writes:
Expected behavior
helm calls :exit-function
No.
helm does not call exit function
:exit-function is only needed for the emacs vanilla completion UI, i.e. "completions" buffer, so yes helm doesn't handle it, though it handle :annotation-function.
What do you want do do exactly?
-- Thierry
Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997
:exit-function is used by the backends (capf functions) to perform post-completion processing(e. g. expanding snippets). ATM the only frontend that does not call :exit-function is helm. It works fine with company-capf, ivy and vanilla. The result is that helm capf frontend does not work with lsp-mode(and probably all other backends that perform post-completion).
Ivan Yonchovski notifications@github.com writes:
:exit-function is used by the backends (capf functions) to perform post-completion processing(e. g. expanding snippets). ATM the only frontend that does not call :exit-function is helm. It works fine with company-capf, ivy and vanilla. The result is that helm capf frontend does not work with lsp-mode(and probably all other backends that perform post-completion).
Thanks for explanation, is this working for you?
diff --git a/helm-mode.el b/helm-mode.el index cb75b989..0dd9e32c 100644 --- a/helm-mode.el +++ b/helm-mode.el @@ -1674,7 +1674,8 @@ Can be used for `completion-in-region-function' by advicing it with an (advice-add 'lisp--local-variables :around #'helm-mode--advice-lisp--local-variables)
-- Thierry
Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997
If you can provide a recipe on how to reproduce with lsp-mode it is perfect ;-) At least with the recipe you sent and the patch above applied, the exit fn is called.
Note: I know nothing about lsp-mode and how to make it working (dependencies etc..). Thanks.
Thank you for the quick reply, I will test it on my side and report back.
Using the patch from above I get an error in lsp-mode
since it is called with candidate = "" (in your case the string
param in completion--done
). I would expect completion--done
to be called with the selected candidate as it was generated from the capf function since we encode properties in it.
Ivan Yonchovski notifications@github.com writes:
Using the patch from above I get an error in lsp-mode since it is called with candidate = "" (in your case the string param in completion--done). I would expect completion--done to be called with the selected candidate as it was generated from the capf function since we encode properties in it.
Ok, thanks, here the modified patch.
diff --git a/helm-mode.el b/helm-mode.el index cb75b989..3cdb81af 100644 --- a/helm-mode.el +++ b/helm-mode.el @@ -1674,7 +1674,8 @@ Can be used for `completion-in-region-function' by advicing it with an (advice-add 'lisp--local-variables :around #'helm-mode--advice-lisp--local-variables)
-- Thierry
Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997
I tested the last patch - the candidate text is the correct one but the text properties are stipped.
Ivan Yonchovski notifications@github.com writes:
I tested the last patch - the candidate text is the correct one but the text properties are stipped.
Yes text properties are always stripped, at least in helm-mode. So what you are expecting is much harder to fix (I mean to fix without breaking everything else).
-- Thierry
Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997
Isn't it possible to fix only this source to provide a lookup and allow finding the original item without changing the helm core stuff? Another option is to do that on our side via hacky buffer-local variable solution to do the same. And the third option is to declare/document both helm capf and lsp-mode incompatible.
Ivan Yonchovski notifications@github.com writes:
Isn't it possible to fix only this source to provide a lookup and allow finding the original item without changing the helm core stuff?
Kind of, this is what I am working on.
-- Thierry
Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997
Can you try last changes?
Merged to master.
I can confirm that it works fine. Thank you.
Expected behavior
helm calls :exit-function
Actual behavior (from
emacs-helm.sh
if possible, see note at the bottom)helm does not call exit function
Steps to reproduce (recipe)
Describe versions of Helm, Emacs, operating system, etc.
Latest from melpa, emacs 27/26 . Linux.
Are you using
emacs-helm.sh
to reproduce this bug? (yes/no):No, but reproduced in clean env with
Are you using Spacemacs? (yes/no):
No.