From 859f49ee26ada2e82ea1d9ccfc8d7ae37f26aaa4 Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Mon, 10 Jan 2022 19:32:19 -0800 Subject: [PATCH] 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 80eb58f5791..bdd0dcccc5e 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)