From: Michael Eliachevitch Date: Wed, 15 Mar 2023 23:49:51 +0000 (+0000) Subject: Document how to construct JSONRPC arrays in Eglot manual X-Git-Tag: emacs-29.0.90~172 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d5d4959ed7de13551311eaf152647d87a6f4faad;p=emacs.git Document how to construct JSONRPC arrays in Eglot manual Many language server configuration options are of the JSON array datatype, for example argument lists for executables, but there wasn't any example of that in the Eglot manual. * doc/misc/eglot.texi (User-specific configuration) (User-specific configuration): Tweaks. (JSONRPC objects in Elisp): Mention JSON arrays. Tweak example. Copyright-paperwork-exempt: Yes --- diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 735da5f0163..a5afb2332c1 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -1201,7 +1201,7 @@ the LSP handshake. This is done using the The argument @code{(:compilationDatabasePath "/tmp")} is Emacs's representation in plist format of a simple JSON object @code{@{"compilationDatabasePath": "/tmp"@}}. To learn how to -represent more deeply nested options in this format, @xref{JSONRPC +represent more deeply nested options in this format, @pxref{JSONRPC objects in Elisp}. In this case, the two examples achieve exactly the same, but notice @@ -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 @ref{Project-specific configuration}. Here is an example: @lisp (setq-default eglot-workspace-configuration @@ -1241,17 +1241,21 @@ 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 Elisp 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 + :cache_for ["pandas" "numpy"] + :pylint (:enabled :json-false)))) :gopls (:usePlaceholders t)) @end lisp -Is serialized by Eglot to the following JSON text: +@noindent +is serialized by Eglot to the following JSON text: @example @{ @@ -1259,7 +1263,8 @@ Is serialized by Eglot to the following JSON text: "plugins": @{ "jedi_completion": @{ "include_params": true, - "fuzzy": true + "fuzzy": true, + "cache_for": [ "pandas", "numpy" ], @}, "pylint": @{ "enabled": false