Function: eglot--workspace-configuration-plist

eglot--workspace-configuration-plist is a byte-compiled function defined in eglot.el.gz.

Signature

(eglot--workspace-configuration-plist SERVER &optional PATH)

Documentation

Returns SERVER's workspace configuration as a plist.

If PATH consider that file's file-name-directory to get the local value of the eglot-workspace-configuration variable, else use the root of SERVER's eglot--project.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(defun eglot--workspace-configuration-plist (server &optional path)
  "Returns SERVER's workspace configuration as a plist.
If PATH consider that file's `file-name-directory' to get the
local value of the `eglot-workspace-configuration' variable, else
use the root of SERVER's `eglot--project'."
  (let ((val (with-temp-buffer
               (setq default-directory
                     (if path
                         (file-name-directory path)
                       (project-root (eglot--project server))))
               ;; Set the major mode to be the first of the managed
               ;; modes.  This is the one the user started eglot in.
               (setq major-mode (car (eglot--major-modes server)))
               (hack-dir-local-variables-non-file-buffer)
               (if (functionp eglot-workspace-configuration)
                   (funcall eglot-workspace-configuration server)
                 eglot-workspace-configuration))))
    (or (and (consp (car val))
             (cl-loop for (section . v) in val
                      collect (if (keywordp section) section
                                (intern (format ":%s" section)))
                      collect v))
        val)))