Skip to content

Commit

Permalink
Deal with 'workspace/diagnostic/refresh' message
Browse files Browse the repository at this point in the history
lsp-mode does not currently support pull diagnostics.

There is a recent change to the spec where the server can notify the
client to request diagnostics, when the pull mode is being used.

This is implemented incorrectly in a number of servers, which do not
first check the relevant client capability.

Mitigate this problem by
a. Sending client capabilities to day that this is not supported
b. Putting a null handler in for the server request message.

Closes emacs-lsp#4570
  • Loading branch information
alanz committed Oct 28, 2024
1 parent 78c194d commit 4b68438
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -3707,6 +3707,7 @@ disappearing, unset all the variables related to it."
:json-false))))))
,@(when lsp-lens-enable '((codeLens . ((refreshSupport . t)))))
,@(when lsp-inlay-hint-enable '((inlayHint . ((refreshSupport . :json-false)))))
(diagnostics . ((refreshSupport . :json-false)))
(fileOperations . ((didCreate . :json-false)
(willCreate . :json-false)
(didRename . t)
Expand Down Expand Up @@ -6945,6 +6946,8 @@ server. WORKSPACE is the active workspace."
(fboundp 'lsp--lens-on-refresh))
(lsp--lens-on-refresh workspace))
nil)
((equal method "workspace/diagnostic/refresh")
nil)
(t (lsp-warn "Unknown request method: %s" method) nil))))
;; Send response to the server.
(unless (eq response 'delay-response)
Expand Down

0 comments on commit 4b68438

Please sign in to comment.