]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't force eglot-strict-mode completely in eglot--dcase
authorJoão Távora <joaotavora@gmail.com>
Tue, 3 Nov 2020 10:26:03 +0000 (10:26 +0000)
committerJoão Távora <joaotavora@gmail.com>
Tue, 3 Nov 2020 10:26:03 +0000 (10:26 +0000)
Doing so was by design, since there's much ambiguity between the
CodeAction and Command objects.  But 'disallow-non-standard-keys is
not necessary to disambiguate, and proved harmful in this bug.

* eglot.el (eglot--dcase): Don't disallow
(eglot--check-dspec): Fix docstring.

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

lisp/progmodes/eglot.el

index bd3bb5337ab0d16202c8492e2f5508ff4e5442c9..b0bd213b48d57c1aafadbf90b8409dc7660248ed 100644 (file)
@@ -373,7 +373,7 @@ on unknown notifications and errors on unknown requests.
             :optional-keys (mapcar #'car optional))))
 
   (defun eglot--check-dspec (interface-name dspec)
-    "Check if variables in DSPEC "
+    "Check destructuring spec DSPEC against INTERFACE-NAME."
     (cl-destructuring-bind (&key required-keys optional-keys &allow-other-keys)
         (eglot--interface interface-name)
       (cond ((or required-keys optional-keys)
@@ -457,10 +457,14 @@ treated as in `eglot-dbind'."
            (cond (interface-name
                   (eglot--check-dspec interface-name vars)
                   ;; In this mode, in runtime, we assume
-                  ;; `eglot-strict-mode' is fully on, otherwise we
+                  ;; `eglot-strict-mode' is partially on, otherwise we
                   ;; can't disambiguate between certain types.
                   `(ignore-errors
-                     (eglot--check-object ',interface-name ,obj-once)))
+                     (eglot--check-object
+                      ',interface-name ,obj-once
+                      t
+                      (memq 'disallow-non-standard-keys eglot-strict-mode)
+                      t)))
                  (t
                   ;; In this interface-less mode we don't check
                   ;; `eglot-strict-mode' at all: just check that the object