>From 8edbaae1c0d8605299c863f4e95c1f3d15b3d158 Mon Sep 17 00:00:00 2001 From: Michael Eliachevitch Date: Tue, 14 Mar 2023 22:47:37 +0100 Subject: [PATCH] Document how to set JSON arrays in eglot-workspace-configuration Many language server configuration options are lists of the JSON array datatype, for example argument lists for executables. These can be configured in emacs lisp as vectors. The eglot documentation talked about confiring json as plists and introduced some basic json datatypes, but didn't yet mention arrays, which this commit introduced. * Other minor changes - Align property lists in eglot documentation, so that keywords of the same level are aligned - Slightly change punctuation before code example to better grammatically integrate the example code and the text. --- doc/misc/eglot.texi | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 735da5f0163..cf4c1d5bcd1 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -1214,7 +1214,7 @@ supported. It consists of @emph{globally} setting @code{eglot-workspace-configuration}, a variable originally intended for project-specific configuration. This has the same effect as giving all your projects a certain default configuration, as described -in @xref{Project-specific configuration}. Here is an example. +in @xref{Project-specific configuration}. Here is an example: @lisp (setq-default eglot-workspace-configuration @@ -1241,17 +1241,20 @@ keyword-value property sub-plists corresponding to JSON sub-objects. For representing the JSON leaf values @code{true}, @code{false}, @code{null} and @code{@{@}}, you can use the Lisp values @code{t}, @code{:json-false}, @code{nil}, and @code{eglot-@{@}}, respectively. +JSON arrays are represented as lisp vectors surrounded by square brackets +(@pxref{Vectors,,,elisp,GNU Emacs Lisp Reference Manual}). -For example, this plist: +For example, the plist @lisp (:pylsp (:plugins (:jedi_completion (:include_params t - :fuzzy t) - :pylint (:enabled :json-false))) + :fuzzy t) + :pylint (:enabled :json-false + :args ["--disable" "C0103"]))) :gopls (:usePlaceholders t)) @end lisp -Is serialized by Eglot to the following JSON text: +is serialized by Eglot to the following JSON text: @example @{ @@ -1262,7 +1265,11 @@ Is serialized by Eglot to the following JSON text: "fuzzy": true @}, "pylint": @{ - "enabled": false + "enabled": false, + "args": [ + "--disable", + "C0103" + ] @} @} @}, -- 2.40.0