From: Augusto Stoffel <arstoffel@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: Yuan Fu <casouri@gmail.com>,
Stephen Leake <stephen_leake@stephe-leake.org>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: Explain a bit more on how to configure language server in Eglot's manual
Date: Wed, 08 Mar 2023 16:01:17 +0100 [thread overview]
Message-ID: <87lek78eyq.fsf@gmail.com> (raw)
In-Reply-To: <CALDnm50UzpRn6NjSAa6u+t+aHAG9vdF7Ym6CE=Azaf6LXcapMQ@mail.gmail.com> ("João Távora"'s message of "Wed, 8 Mar 2023 13:54:55 +0000")
On Wed, 8 Mar 2023 at 13:54, João Távora wrote:
>> > The dotted-to-plist translator proposed is optional. Some people
>> > requested use of dotted notation and that will surely need a
>> > translator. I wouldn't use it.
>>
>> Given how selective you are with the features you want to add, I don't
>> understand why you think this particular one should make it in. It
>> would sure help a little, maybe, sometimes.
>
> I don't understand: didn't you state you _like_ dotted notation?
Yes, as a quick fix. But you and the circumstances showed that it isn't
nearly good enough.
> A special plist editing mode for a single Eglot variable falls into
> that category, IMNSHO.
By the way, my suggestion is to edit a JSON value, which is what the
server receives, you can copy and paste from other places, and doesn't
require you to know jsonrpc.el internals such as :json-false and the
translation of nil.
> Dotted option notation does not. It seems to be an LSP practice,
It may be a practice, but the ground truth is a JSON object.
> and I don't see any other good place to put a single utility function
> that facilitates it but in Eglot.
The utility function belongs to map.el. It is called `assoc-in` in
Clojure.
Speaking of bloat, and I know I shouldn't insist, but a basic version of
the savable eglot-show-workspace-configuration barely adds 30 LOC.
I'm pasting it here in case it helps anybody.
--8<---------------cut here---------------start------------->8---
(defvar-local eglot-wsconf--server nil)
(defvar eglot-wsconf-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-c" #'eglot-wsconf-commit)
map))
(defun eglot-wsconf-commit ()
(interactive)
(let ((wsconf (save-excursion
(goto-char (point-min))
(jsonrpc--json-read))))
(save-window-excursion
(let ((default-directory (project-root (eglot--project eglot-wsconf--server)))
(buffers (buffer-list)))
(add-dir-local-variable nil 'eglot-workspace-configuration wsconf)
(save-buffer)
(if (memq (current-buffer) buffers) (bury-buffer) (kill-buffer))))
(eglot-signal-didChangeConfiguration eglot-wsconf--server)
(quit-window t)))
;;;###autoload
(defun eglot-wsconf-edit (server)
"Edit the language server workspace configuration."
(interactive (list (eglot--read-server "Show workspace configuration for" t)))
(pop-to-buffer (eglot-show-workspace-configuration server))
(use-local-map eglot-wsconf-map)
(setq-local header-line-format (substitute-command-keys "\
Press \\[eglot-wsconf-commit] to commit changes"))
(setq eglot-wsconf--server server))
--8<---------------cut here---------------end--------------->8---
next prev parent reply other threads:[~2023-03-08 15:01 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-05 4:45 Explain a bit more on how to configure language server in Eglot's manual Yuan Fu
2023-03-05 22:36 ` [SPAM UNSURE] " Stephen Leake
2023-03-06 0:16 ` João Távora
2023-03-06 22:28 ` Yuan Fu
2023-03-07 11:59 ` João Távora
2023-03-08 13:27 ` Augusto Stoffel
2023-03-08 13:54 ` João Távora
2023-03-08 15:01 ` Augusto Stoffel [this message]
2023-03-08 19:43 ` João Távora
2023-03-08 20:43 ` Augusto Stoffel
2023-03-09 9:43 ` João Távora
2023-03-08 23:19 ` Yuan Fu
2023-03-09 8:18 ` Augusto Stoffel
2023-03-09 17:20 ` Juri Linkov
2023-03-10 6:26 ` Yuan Fu
2023-03-10 7:59 ` João Távora
2023-03-09 17:40 ` João Távora
2023-03-09 18:05 ` Juri Linkov
2023-03-09 18:32 ` Augusto Stoffel
2023-03-09 8:28 ` Explain a bit more on how to configure language server in Eglot's manual' Augusto Stoffel
2023-03-08 15:24 ` Explain a bit more on how to configure language server in Eglot's manual Yuri Khan
2023-03-08 15:27 ` João Távora
2023-03-08 15:52 ` Yuri Khan
2023-03-08 16:03 ` João Távora
2023-03-09 11:18 ` [SPAM UNSURE] " João Távora
2023-03-10 6:23 ` Yuan Fu
2023-03-14 18:09 ` Michael Eliachevitch
2023-03-14 18:53 ` João Távora
2023-03-14 22:27 ` [PATCH] " Michael Eliachevitch
2023-03-15 11:49 ` Michael Eliachevitch
2023-03-15 12:35 ` Eli Zaretskii
2023-03-15 12:52 ` Michael Eliachevitch
2023-03-15 18:54 ` João Távora
2023-03-15 19:26 ` Michael Eliachevitch
2023-03-16 0:09 ` João Távora
2023-03-06 10:34 ` Augusto Stoffel
2023-03-06 10:51 ` João Távora
2023-03-06 11:00 ` Augusto Stoffel
2023-03-06 11:13 ` João Távora
2023-03-06 11:30 ` Pedro Andres Aranda Gutierrez
2023-03-06 11:46 ` João Távora
2023-03-06 13:08 ` Augusto Stoffel
2023-03-06 13:50 ` João Távora
2023-03-06 16:10 ` Augusto Stoffel
2023-03-06 16:25 ` João Távora
2023-03-06 18:18 ` Augusto Stoffel
2023-03-06 18:32 ` João Távora
2023-03-06 20:16 ` Pedro Andres Aranda Gutierrez
2023-03-06 21:13 ` Augusto Stoffel
2023-03-06 21:38 ` João Távora
2023-03-06 13:01 ` Augusto Stoffel
-- strict thread matches above, loose matches on Subject: below --
2023-03-12 12:09 Pedro Andres Aranda Gutierrez
2023-03-12 19:52 ` João Távora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lek78eyq.fsf@gmail.com \
--to=arstoffel@gmail.com \
--cc=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
--cc=stephen_leake@stephe-leake.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.