-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C-M-i: with a single candiate snippet completion doesn't work #311
Comments
nemethf
added a commit
to nemethf/eglot
that referenced
this issue
Oct 5, 2019
The :exit-function of the completion command doesn't get called under special circumstances. Fix this by altering the completion candidate. Closes joaotavora#311. * eglot.el (eglot--tailor-completions): New function. (eglot-completion-at-point): Use it.
This is a duplicate of #279. Although it's not necessary to have textEdit in the reply as the example above shows. And the bug is triggered only when the server returns just a single completion item. But the analysis there is correct. |
nemethf
added a commit
to nemethf/eglot
that referenced
this issue
Oct 6, 2019
The :exit-function of the completion command doesn't get called under special circumstances. Fix this by altering the completion candidate. Closes joaotavora#311. Closes joaotavora#279. * eglot.el (eglot--tailor-completions): New function. (eglot-completion-at-point): Use it.
nemethf
added a commit
to nemethf/eglot
that referenced
this issue
Oct 6, 2019
* eglot-tests.el (snippet-completions): New test.
joaotavora
added a commit
that referenced
this issue
Oct 12, 2019
Fixes #313, fixes #311, fixes #279 As is well known, LSP's and Emacs's completion mechanics don't fit very well together, mostly because Emacs expects completion to be a something of a pure function of a string argument and LSP treats as a function of a concrete buffer position. A further complication arises because some completion frontends like "bare" completion-at-point make Emacs modify the buffer's contents during the completion process, while other (notably company-mode) don't do that. Thus eglot-completion-at-point must take extra care not to inadvertently garble its (quite hacky) "completions", which is used to cache the last LSP response and retrieve much more than just the completion text in the :exit-function callback. In yet another related problem, :exit-function won't be called at all with completion-at-point if the completion table doesn't answer properly to test-completion. completion-table-dynamic is not enough to save us here so we must answer that 'lambda' request separately. * eglot.el (eglot-completion-at-point): Rework.
joaotavora
pushed a commit
that referenced
this issue
Oct 12, 2019
* eglot-tests.el (snippet-completions): New test.
joaotavora
pushed a commit
that referenced
this issue
Oct 14, 2019
* eglot-tests.el (snippet-completions): New test.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 18, 2022
Fixes joaotavora/eglot#313, fixes joaotavora/eglot#311, fixes joaotavora/eglot#279 As is well known, LSP's and Emacs's completion mechanics don't fit very well together, mostly because Emacs expects completion to be a something of a pure function of a string argument and LSP treats as a function of a concrete buffer position. A further complication arises because some completion frontends like "bare" completion-at-point make Emacs modify the buffer's contents during the completion process, while other (notably company-mode) don't do that. Thus, 'eglot-completion-at-point' must take extra care to answer to the questions listed in the "(elisp)Programmed Completion" info node based on its (quite hacky) "completions" local var and _not_ based on the intermediate buffer contents. That var is also used to cache the last LSP response and allow the :exit-function callback to retrieve much more than just the completion text in In yet another related problem, :exit-function won't be called at all with completion-at-point if the completion table doesn't answer properly to test-completion. A previous use of completion-table-dynamic was found to be unsuitable here: we must answer all the requests separately. * eglot.el (eglot-completion-at-point): Rework.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 19, 2022
Fixes joaotavora/eglot#313, fixes joaotavora/eglot#311, fixes joaotavora/eglot#279 As is well known, LSP's and Emacs's completion mechanics don't fit very well together, mostly because Emacs expects completion to be a something of a pure function of a string argument and LSP treats as a function of a concrete buffer position. A further complication arises because some completion frontends like "bare" completion-at-point make Emacs modify the buffer's contents during the completion process, while other (notably company-mode) don't do that. Thus, 'eglot-completion-at-point' must take extra care to answer to the questions listed in the "(elisp)Programmed Completion" info node based on its (quite hacky) "completions" local var and _not_ based on the intermediate buffer contents. That var is also used to cache the last LSP response and allow the :exit-function callback to retrieve much more than just the completion text in In yet another related problem, :exit-function won't be called at all with completion-at-point if the completion table doesn't answer properly to test-completion. A previous use of completion-table-dynamic was found to be unsuitable here: we must answer all the requests separately. * eglot.el (eglot-completion-at-point): Rework.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 19, 2022
Fixes #313, fixes #311, fixes #279 As is well known, LSP's and Emacs's completion mechanics don't fit very well together, mostly because Emacs expects completion to be a something of a pure function of a string argument and LSP treats as a function of a concrete buffer position. A further complication arises because some completion frontends like "bare" completion-at-point make Emacs modify the buffer's contents during the completion process, while other (notably company-mode) don't do that. Thus, 'eglot-completion-at-point' must take extra care to answer to the questions listed in the "(elisp)Programmed Completion" info node based on its (quite hacky) "completions" local var and _not_ based on the intermediate buffer contents. That var is also used to cache the last LSP response and allow the :exit-function callback to retrieve much more than just the completion text in In yet another related problem, :exit-function won't be called at all with completion-at-point if the completion table doesn't answer properly to test-completion. A previous use of completion-table-dynamic was found to be unsuitable here: we must answer all the requests separately. * eglot.el (eglot-completion-at-point): Rework. #313: joaotavora/eglot#313 #311: joaotavora/eglot#311 #279: joaotavora/eglot#279
jollaitbot
pushed a commit
to sailfishos-mirror/emacs
that referenced
this issue
Oct 12, 2022
Fixes joaotavora/eglot#313, fixes joaotavora/eglot#311, fixes joaotavora/eglot#279 As is well known, LSP's and Emacs's completion mechanics don't fit very well together, mostly because Emacs expects completion to be a something of a pure function of a string argument and LSP treats as a function of a concrete buffer position. A further complication arises because some completion frontends like "bare" completion-at-point make Emacs modify the buffer's contents during the completion process, while other (notably company-mode) don't do that. Thus, 'eglot-completion-at-point' must take extra care to answer to the questions listed in the "(elisp)Programmed Completion" info node based on its (quite hacky) "completions" local var and _not_ based on the intermediate buffer contents. That var is also used to cache the last LSP response and allow the :exit-function callback to retrieve much more than just the completion text in In yet another related problem, :exit-function won't be called at all with completion-at-point if the completion table doesn't answer properly to test-completion. A previous use of completion-table-dynamic was found to be unsuitable here: we must answer all the requests separately. * eglot.el (eglot-completion-at-point): Rework.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
C-M-i after
fun_
pops up a Completion buffer withand snippets work if I select one of the candidates.
However, C-M-i after
fun_a
insertsa(a, b)
without the possibility to edita
andb
with yasnippet.Reading the protocol messages doesn't help me, but the answer in the fist case:
The answer in the second case:
The text was updated successfully, but these errors were encountered: