unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Marcin Pajkowski <marcin.pajkowski@gmail.com>
To: 59465@debbugs.gnu.org
Subject: bug#59465: Eglot does not advertise resolveSupport capabilities
Date: Mon, 21 Nov 2022 22:04:27 +0100	[thread overview]
Message-ID: <CAPZ_WRHoazG1M+y3PnZi64_M=ovDfHjA2SZ1AnF-TwnamrVK7w@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 361 bytes --]

Hi Emacs developers,

I recently found that Eglot does not receive
completions with additional text edits from servers
that expect such capability to be advertised by client.

This advertisement is required by rust-analyzer server
to provide completions for symbols that are not resolved
but can be automatically imported.

This patch fixes this issue.

Marcin

[-- Attachment #1.2: Type: text/html, Size: 423 bytes --]

[-- Attachment #2: Eglot-Advertise-completion.resolveSupport-capabilities.patch --]
[-- Type: text/x-patch, Size: 1450 bytes --]

From b290face2792b254ad9567d007205e715da48283 Mon Sep 17 00:00:00 2001
From: Marcin Pajkowski <marcin.pajkowski@gmail.com>
Date: Sun, 20 Nov 2022 20:03:57 +0100
Subject: [PATCH] Eglot: Advertise completion.resolveSupport capabilities

Some servers avoid reporting completion items that require
"additionalTextEdits" capability. Actually eglot-completion-at-point
function supports such feature so it can be advertised to LSP server.

* lisp/progmodes/eglot.el
  (eglot-client-capabilities): Advertise resolveSupport
---
 lisp/progmodes/eglot.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index bbd902c1c7..fab3b1cac0 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -737,7 +737,10 @@ eglot-client-capabilities
                                            t
                                          :json-false)
                                       :deprecatedSupport t
+                                      :resolveSupport (:properties
+                                                       ["documentation"
+                                                        "details"
+                                                        "additionalTextEdits"])
                                       :tagSupport (:valueSet [1]))
                                     :contextSupport t)
              :hover              (list :dynamicRegistration :json-false
--
2.38.1

             reply	other threads:[~2022-11-21 21:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 21:04 Marcin Pajkowski [this message]
2022-11-22 20:24 ` bug#59465: Eglot does not advertise resolveSupport capabilities Marcin Pajkowski
2022-11-24 11:52   ` Eli Zaretskii
2022-11-24 12:47     ` João Távora
2022-11-24 14:18       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPZ_WRHoazG1M+y3PnZi64_M=ovDfHjA2SZ1AnF-TwnamrVK7w@mail.gmail.com' \
    --to=marcin.pajkowski@gmail.com \
    --cc=59465@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).