[Top][All Lists]

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

[elpa] externals/eglot 6d87de1 35/69: Treat null/nil server capabilities

From: João Távora
Subject: [elpa] externals/eglot 6d87de1 35/69: Treat null/nil server capabilities as false
Date: Sun, 20 Oct 2019 08:21:48 -0400 (EDT)

branch: externals/eglot
commit 6d87de16c5f86c5479db5e6705f0fb93fe727d3e
Author: Joram Schrijver <address@hidden>
Commit: Joram Schrijver <address@hidden>

    Treat null/nil server capabilities as false
    Some language servers may specify null for some capabilities in the list
    of server capabilities. This does not conform to the specification, but
    treating it as false is more reasonable than treating it as true.
    A current example is the PHP language server. which specifies null for
    every capability it does not handle, like documentHighlightProvider.
    This would cause Eglot to send constant textDocument/documentHighlight
    requests, which all timed out.
    * eglot.el (eglot--server-capable): Change the handling of null values
      for capabilities to treat them as false instead of true.
    Copyright-paperwork-exempt: yes
 eglot.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eglot.el b/eglot.el
index 23d53ed..845f029 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1101,6 +1101,9 @@ under cursor."
              for probe = (plist-member caps feat)
              if (not probe) do (cl-return nil)
              if (eq (cadr probe) :json-false) do (cl-return nil)
+             ;; If the server specifies null as the value of the capability, it
+             ;; makes sense to treat it like false.
+             if (null (cadr probe)) do (cl-return nil)
              if (not (listp (cadr probe))) do (cl-return (if more nil (cadr 
              finally (cl-return (or (cadr probe) t)))))

reply via email to

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