Skip to content

Commit cb7ec94

Browse files
authored
Fix: Local variables not safe (#3330)
lsp-file-watch-ignored-directories and lsp-file-watch-ignored-files were not being respected as safe, when opening the first LSP project. Added autoload magic comments to the safe-local-variable definitions and to the predicate function lsp--string-listp.
1 parent 2950bee commit cb7ec94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lsp-mode.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ the global level or at a root of an lsp workspace."
373373
lsp-file-watch-ignored-directories)
374374

375375
;; Allow lsp-file-watch-ignored-directories as a file or directory-local variable
376-
(put 'lsp-file-watch-ignored-directories 'safe-local-variable 'lsp--string-listp)
376+
;;;###autoload(put 'lsp-file-watch-ignored-directories 'safe-local-variable 'lsp--string-listp)
377377

378378
(defcustom lsp-file-watch-ignored-files
379379
'(
@@ -399,7 +399,7 @@ level or at a root of an lsp workspace."
399399
:package-version '(lsp-mode . "8.0.0"))
400400

401401
;; Allow lsp-file-watch-ignored-files as a file or directory-local variable
402-
(put 'lsp-file-watch-ignored-files 'safe-local-variable 'lsp--string-listp)
402+
;;;###autoload(put 'lsp-file-watch-ignored-files 'safe-local-variable 'lsp--string-listp)
403403

404404
(defcustom lsp-after-uninitialized-functions nil
405405
"List of functions to be called after a Language Server has been uninitialized."
@@ -1045,6 +1045,7 @@ calling `remove-overlays'.")
10451045
"Return a sequence of the elements of SEQUENCE except the first one."
10461046
(seq-drop sequence 1))
10471047

1048+
;;;###autoload
10481049
(defun lsp--string-listp (sequence)
10491050
"Return t if all elements of SEQUENCE are strings, else nil."
10501051
(not (seq-find (lambda (x) (not (stringp x))) sequence)))

0 commit comments

Comments
 (0)