]> git.eshelyaron.com Git - emacs.git/commitdiff
Only consider eglot's own diagnostics in eglot-code-actions
authorMichal Krzywkowski <k.michal@zoho.com>
Wed, 8 May 2019 11:33:34 +0000 (13:33 +0200)
committerJoão Távora <joaotavora@gmail.com>
Wed, 8 May 2019 11:33:34 +0000 (12:33 +0100)
* eglot.el (eglot-code-actions): Filter out non-eglot diagnostics
  before sending a request to the server.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/260

lisp/progmodes/eglot.el

index ef0cb08342e4320a2843ee9c2e34af14703b5c37..f5d81e4aa4c542f5a693f49ae39eb14f2ed053b4 100644 (file)
@@ -2297,10 +2297,9 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp."
                               :end (eglot--pos-to-lsp-position end))
                  :context
                  `(:diagnostics
-                   [,@(mapcar (lambda (diag)
-                                (cdr (assoc 'eglot-lsp-diag
-                                            (eglot--diag-data diag))))
-                              (flymake-diagnostics beg end))]))))
+                   [,@(cl-loop for diag in (flymake-diagnostics beg end)
+                               when (cdr (assoc 'eglot-lsp-diag (eglot--diag-data diag)))
+                               collect it)]))))
          (menu-items
           (or (mapcar (jsonrpc-lambda (&rest all &key title &allow-other-keys)
                         (cons title all))