From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Eliachevitch Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Explain a bit more on how to configure language server in Eglot's manual Date: Wed, 15 Mar 2023 12:52:45 +0000 Message-ID: <87o7oudv7s.fsf@posteo.de> References: <86sfeisu49.fsf@stephe-leake.org> <87356gvkkb.fsf@gmail.com> <87wn3jgof2.fsf@posteo.de> <878rfzt0h7.fsf@posteo.de> <833566ry3v.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35267"; mail-complaints-to="usenet@ciao.gmane.io" Cc: joaotavora@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 15 14:02:52 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcQmK-0008zj-9m for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Mar 2023 14:02:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcQlc-0000p4-Ed; Wed, 15 Mar 2023 09:02:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcQlJ-0000iY-Fb for emacs-devel@gnu.org; Wed, 15 Mar 2023 09:01:56 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcQlH-0005rb-A8 for emacs-devel@gnu.org; Wed, 15 Mar 2023 09:01:49 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2A760240785 for ; Wed, 15 Mar 2023 14:01:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1678885305; bh=4+GXAVygJk0Sr5vRgsBIwQVeefgf83S7q2noJHXkZss=; h=From:To:Cc:Subject:Date:Autocrypt:OpenPGP:From; b=AdJHOKKwAuXn8YO+eutad5Uzc2Fy1CfTSdcZNbiXwPAqnSPUKTSRim8WKfd6gQfD8 R1GLjEFrTYSU3FhuR5HRo2iJsyZ0AmyyH39O95m8sEoxSfi1Ad5g/SIIS9WSEh3sQQ Qk9VRexwTLSRfnu9RMx7kDqT/oVWamIOU86odGn6rjD3a4PlLOP1+Fwu6P27Kd47K4 ELdpflOLcBmXSr3PEhIh9QBXn8IUmLq//zguYt1/5y5w3QjsLkdhRInsDZ9eMRH1oa 6voNuHrAGmHUdx1BDG4PIKUDiK5NTJFudT61MMOPZakEiMI/OPW4odh8OAwFyxPYVr mH9UWbNKX3bQA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pc9Wr4LLzz6tsQ; Wed, 15 Mar 2023 14:01:43 +0100 (CET) In-reply-to: <833566ry3v.fsf@gnu.org> Autocrypt: addr=m.eliachevitch@posteo.de; keydata=xsBNBFHFxZABCADAAv2siayhA7Etl85WcwcyMPBD2bt/6Wh3A8a12AURV5J4tprzgbdlxC0w1LofvklG7ls25NERAY931hvQW+f5GEI0pwoNNFXEkKDa8/J4SxhrqXx8CJA85owPq1g4cFeO1ooQJ32BewlRGsnhd+taYExZ76oaMnFtx6jYjf6mPbjDyiLhC+Og3MBpOqAnmX7mhStgJl0uru1ZGEB17tzzVuQ4ljDv/MvUagVFymQBhmlbzvze5eLeDn90Ot0DjWHy3HzCFMEnVqQy8rmEA8N9GOANwyMY79KVymsPakeNwacPRFzYXCZvolC5jtY6I/1ALvVtNc45JyZWty+rMPo3ABEBAAHNGG0uZWxpYWNoZXZpdGNoQHBvc3Rlby5kZcLAlAQTAQgAPhYhBFRpCMeCODrQ59iU7BuPlcgSXc4xBQJgUmWNAhsDBQkSToKgBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBuPlcgSXc4xqC8H/06lkI7BimgkSobuEzsD9LsIPEyz5uUaQAP77u1nfoO1vB0DEdPxn7f3H3Hs7nyUfPgvgsn+9rTSV+ubHH5f/bzgQZgES2WItbV7iM290j6nWSc/iCTLlTmM2KMNvbMB9xGzV0m+UjMyAa9zUhB/3N+rd5ya/oSiTKw2/UbgfM5fR1knIUgPDENlKjJvO7/71Sxwpc+gKvAR9lHRT8JzQMyFaFO+zbo53Z7FzDTuj7zVyQ4MPIhe+UMI4rtNZeyPDM0QTep0+N39JbDhvUVevOh 15XJTYXl2Zdhl/yunnOibtg3XKtToakc4FjWJGrw8njbges5YqaodeMq OpenPGP: url=https://posteo.de/keys/m.eliachevitch@posteo.de.asc Received-SPF: pass client-ip=185.67.36.66; envelope-from=m.eliachevitch@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304496 Archived-At: --=-=-= Content-Type: text/plain; format=flowed Thanks Eli, I incorporated your comments into v2 of the patch attached below. >> 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: > > @xref here is wrong: it produces a capitalized "See", so is only > appropriate at the beginning of a sentence. You want @pxref instead. Good point. However, due to the "as described" above, I think it should just be a @ref instead. I also found a wrong @xref inside a sentence in line 1201 of eglot.texi, which I now also replaced by @pxref v2 of my patch. > If you want to continue a sentence after @lisp, you need to have > @noindent before the text. Thanks, also incorporated that. Cheers, Michael --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-Document-how-to-set-JSON-arrays-in-eglot-workspac.patch Content-Description: v2 of patch that documents how to represent json arrays as vectors in eglot/jsonrpc >From 4cbaa88d2a19cc59e727efd35ba17facdc36b01e Mon Sep 17 00:00:00 2001 From: Michael Eliachevitch Date: Tue, 14 Mar 2023 22:47:37 +0100 Subject: [PATCH v2] 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 | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 735da5f0163..d6c43c8ac02 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -1201,7 +1201,7 @@ User-specific configuration 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 @@ User-specific configuration @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 @@ JSONRPC objects in Elisp 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: +@noindent +is serialized by Eglot to the following JSON text: @example @{ @@ -1262,7 +1266,11 @@ JSONRPC objects in Elisp "fuzzy": true @}, "pylint": @{ - "enabled": false + "enabled": false, + "args": [ + "--disable", + "C0103" + ] @} @} @}, -- 2.40.0 --=-=-=--