emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs 9adb310e08 021/120: Don't error out on unsupported d


From: João Távora
Subject: feature/eglot2emacs 9adb310e08 021/120: Don't error out on unsupported diagnostic.codedescription
Date: Thu, 20 Oct 2022 07:16:46 -0400 (EDT)

branch: feature/eglot2emacs
commit 9adb310e08410b555651d7b819671842bd99f2c1
Author: Brian Leung <bkleung89@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Don't error out on unsupported diagnostic.codedescription
    
    A codeDescription property is, at the time of writing, an object with
    an href property (of type URI, or a string), denoting a "URI to open
    with more information about the diagnostic error".
    
    It's not obvious how best to put this into a Flymake diagostic
    aside from simply appending it to the diagnostic message, so we'll
    worry about it some other time.
    
    * eglot.el (eglot--lsp-interface-alist)
    (eglot-client-capabilities): Don't error out on unsupported
    Diagnostic.codeDescription.
    
    GitHub-reference: fix https://github.com/joaotavora/eglot/issues/768
---
 lisp/progmodes/eglot.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 80eb58f579..bdd0dcccc5 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -351,7 +351,7 @@ This can be useful when using docker to run a language 
server.")
                              :sortText :filterText :insertText 
:insertTextFormat
                              :textEdit :additionalTextEdits :commitCharacters
                              :command :data))
-      (Diagnostic (:range :message) (:severity :code :source 
:relatedInformation))
+      (Diagnostic (:range :message) (:severity :code :source 
:relatedInformation :codeDescription))
       (DocumentHighlight (:range) (:kind))
       (FileSystemWatcher (:globPattern) (:kind))
       (Hover (:contents) (:range))
@@ -689,7 +689,11 @@ treated as in `eglot-dbind'."
              :formatting         `(:dynamicRegistration :json-false)
              :rangeFormatting    `(:dynamicRegistration :json-false)
              :rename             `(:dynamicRegistration :json-false)
-             :publishDiagnostics `(:relatedInformation :json-false))
+             :publishDiagnostics (list :relatedInformation :json-false
+                                       ;; TODO: We can support 
:codeDescription after
+                                       ;; adding an appropriate UI to
+                                       ;; Flymake.
+                                       :codeDescriptionSupport :json-false))
             :experimental eglot--{})))
 
 (defclass eglot-lsp-server (jsonrpc-process-connection)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]