emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 d3669cfe15 1/2: Eglot: allow skipping compile-time warnings abo


From: João Távora
Subject: emacs-29 d3669cfe15 1/2: Eglot: allow skipping compile-time warnings about LSP interfaces
Date: Sun, 11 Dec 2022 19:12:23 -0500 (EST)

branch: emacs-29
commit d3669cfe156f43ca17b5d804fc9fd7fa1f8b0e26
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Eglot: allow skipping compile-time warnings about LSP interfaces
    
    * lisp/progmodes/eglot.el (eglot-strict-mode): Add 'no-unknown-interfaces'.
    (eglot--check-object): Honour new eglot-strict-mode value.
---
 lisp/progmodes/eglot.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 2ef022992e..2427e7b9d3 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -499,7 +499,7 @@ Here's what an element of this alist might look like:
       ;; disallow-non-standard-keys
       ;; enforce-required-keys
       ;; enforce-optional-keys
-      )
+      no-unknown-interfaces)
     "How strictly to check LSP interfaces at compile- and run-time.
 
 Value is a list of symbols (if the list is empty, no checks are
@@ -520,7 +520,10 @@ happens at run-time.  At compile-time, a warning is raised 
if a
 destructuring spec doesn't use all optional fields.
 
 If the symbol `disallow-unknown-methods' is present, Eglot warns
-on unknown notifications and errors on unknown requests."))
+on unknown notifications and errors on unknown requests.
+
+If the symbol `no-unknown-interfaces' is present, Eglot warns at
+compile time if an undeclared LSP interface is used."))
 
 (cl-defun eglot--check-object (interface-name
                                object
@@ -594,7 +597,7 @@ on unknown notifications and errors on unknown requests."))
                (when missing-out (byte-compile-warn
                                   "Destructuring for %s is missing out on %s"
                                   interface-name missing-out))))
-            (t
+            ((memq 'no-unknown-interfaces eglot-strict-mode)
              (byte-compile-warn "Unknown LSP interface %s" interface-name))))))
 
 (cl-defmacro eglot--dbind (vars object &body body)



reply via email to

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