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: Tue, 14 Mar 2023 22:27:00 +0000 Message-ID: <878rfzt0h7.fsf@posteo.de> References: <86sfeisu49.fsf@stephe-leake.org> <87356gvkkb.fsf@gmail.com> <87wn3jgof2.fsf@posteo.de> 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="16151"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 14 23:47:43 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 1pcDQl-0003yN-Ql for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Mar 2023 23:47:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcDQ0-0003AI-Bq; Tue, 14 Mar 2023 18:46:56 -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 1pcDPz-0003A9-38 for emacs-devel@gnu.org; Tue, 14 Mar 2023 18:46:55 -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 1pcDPw-000331-V9 for emacs-devel@gnu.org; Tue, 14 Mar 2023 18:46:54 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DE6FA2409CB for ; Tue, 14 Mar 2023 23:46:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1678834010; bh=AlTV2ogUB48aCO5hGu6JvF8Y//BsZd8z02tK1GPcp7A=; h=From:To:Cc:Subject:Date:Autocrypt:OpenPGP:From; b=lREJqs0jXICF1m8rEqe3RRK2Llr26dolH+pY8N5UT5sAXNVYzCPJxcmi33wP3msRq kvsHLxUzu6IpMnE3b5afyA4ETUI+jNis5ahRn+qT+3sTGj14ykr+0Qf2CYv0LHY7DX lowE1VsDjrSAqcIgq3Gqg8cuPieR8vYyGnfRB/7psYl/HYJNVaf4ROy+908TcPrtmu nayw6d2OEi0okq7kLUwf+AAp8GhL3kgEYBwJGKLAM0IfCeknTdjUXkIs9V0TJ3p4K9 VuSecSHdeZ2fDw+f6yrNephC7A+Sy/D74Leqcs1wukSMyVwFh4pKXISKMOrmi/mbhi nPCxUMjsLkI7g== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PbpYQ092wz9rxD; Tue, 14 Mar 2023 23:46:47 +0100 (CET) In-reply-to: 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=ham 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:304463 Archived-At: --=-=-= Content-Type: text/plain; format=flowed > OK, Can you submit a patch? Bonus points if you add your :texlab example. Here you go. This is my first Emacs patch and I hope it's fine like this as I'm not very experienced with this patch email workflow. Is it okay that I sent it in a reply as an attachment or should I have started a new thread for the patch? In the patch I mention that arrays can be represented as vector datatypes and extend the existing advanced configuration :pylsp example with an array option. Further, the patch also fixes the indentation for the example. Further, the patch introduces some changes to the punctuation before/after the configuration examples, because stylistically I think they should be considered part of the surrounding text. If you want I could make this a separate patch or you can revert those changes. I admit this is also personal preference, I have some personal opinions on that but they are not strong. Initially I didn't know how to find the proper xref reference to vectors in the elisp manual, but luckily with some grepping I found another place where that manual section was referenced and just copied that xref (this is also my first time writing texinfo). I didn't rebuild the documentation yet but hope it will be fine. The changes are also described in the commit message in the patch. Cheers, Michael --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Document-how-to-set-JSON-arrays-in-eglot-workspace-c.patch >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 --=-=-=--