Variable: eglot-workspace-configuration

eglot-workspace-configuration is a buffer-local variable defined in eglot.el.gz.

Documentation

Configure LSP servers specifically for a given project.

This variable's value should be a plist (SECTION VALUE ...). SECTION is a keyword naming a parameter section relevant to a particular server. VALUE is a plist or a primitive type converted to JSON also understood by that server.

Instead of a plist, an alist ((SECTION . VALUE) ...) can be used instead, but this variant is less reliable and not recommended.

This variable should be set as a directory-local variable. See info node (emacs)Directory Variables for various ways to do that.

Here's an example value that establishes two sections relevant to the Pylsp and Gopls LSP servers:

  (:pylsp (:plugins (:jedi_completion (:include_params t
                                       :fuzzy t)
                     :pylint (:enabled :json-false)))
   :gopls (:usePlaceholders t))

The value of this variable can also be a unary function of a single argument, which will be a connected eglot-lsp-server(var)/eglot-lsp-server(fun) instance. The function runs with default-directory set to the root of the current project. It should return an object of the format described above.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(defvar-local eglot-workspace-configuration ()
  "Configure LSP servers specifically for a given project.

This variable's value should be a plist (SECTION VALUE ...).
SECTION is a keyword naming a parameter section relevant to a
particular server.  VALUE is a plist or a primitive type
converted to JSON also understood by that server.

Instead of a plist, an alist ((SECTION . VALUE) ...) can be used
instead, but this variant is less reliable and not recommended.

This variable should be set as a directory-local variable.  See
info node `(emacs)Directory Variables' for various ways to do that.

Here's an example value that establishes two sections relevant to
the Pylsp and Gopls LSP servers:

  (:pylsp (:plugins (:jedi_completion (:include_params t
                                       :fuzzy t)
                     :pylint (:enabled :json-false)))
   :gopls (:usePlaceholders t))

The value of this variable can also be a unary function of a
single argument, which will be a connected `eglot-lsp-server'
instance.  The function runs with `default-directory' set to the
root of the current project.  It should return an object of the
format described above.")