unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Augusto Stoffel <arstoffel@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: 61868@debbugs.gnu.org
Subject: bug#61868: 29.0.60; Eglot: setting "workspace" configurations should be easier
Date: Wed, 01 Mar 2023 08:39:00 +0100	[thread overview]
Message-ID: <87k000x6nf.fsf@gmail.com> (raw)
In-Reply-To: <87v8jlns9z.fsf@gmail.com> ("João Távora"'s message of "Wed, 01 Mar 2023 02:02:00 +0000")

On Wed,  1 Mar 2023 at 02:02, João Távora wrote:

> Oh but no :-) there are even scary DSLs in Emacs variables.  See
> project-kill-buffer-conditions for example.  And customize-variable
> groks it.

Yes, but the server configuration is not a DSL.  It's just a list of
variable names, but with deeply nested namespace.  So, say
pylsp.plugins.jedi_completion.include_params can only be true of false.
There is no mini-language to say when it's effectively true of false.

> In effect you want something like customize-variable, but different UI
> and with support for saving to .dir-locals.el.  I sympathize with the
> idea, I really do, for two distinct reasons:

A Customize kind of UI would be really cool, but then LSP needs a new
capability whereby the server sends a "schema" of the accepted options
(their names, types, documentation, etc.)

> So if this UI appears elsewhere, like a separate package, Eglot can take
> advantage. But I'm afraid I don't like the idea of starting this in
> Eglot, so it's probably not going to happen as long as I am maintainer.

The UI I'm suggesting is absolutely commonplace in Emacs: you edit the
eglot-show-workspace-configuration buffer and press C-c C-c to commit
the changes.  Compare with VC log, Magit commit, Org capture, PDF-Tools
annotations.  We'll just use the same base libraries.

>> [ Incidentally, when I suggested to allow such syntax:
>>
>>        ((python-mode
>>        . ((eglot-workspace-configuration
>>            . (("pylsp.plugins.jedi_completion.include_params" . t)
>>               ("pylsp.plugins.jedi_completion.fuzzy" . t)
>>               ("pylsp.plugins.pylint.enabled" . :json-false))))))
>>
>>    you said it was un-Lispy or something, but I really think it's rather
>>    the opposite.  Emacs has flat names pretty much like the above. ]
>
> It's indeed un-Lispy, but it's not very hard to write a helper function
> to turn that into a plist, is it?

Is it though?  Replace the dots by hyphens, and you will find some real
Emacs user options:

    vc.svn.program
    vc.git.program
    vc.git.log-edit.summary.target-len
    vc.git.log-edit.summary.max-len


>>>   (defun eglot-edit-workspace-configuration () (interactive)
>>>     (find-file (expand-file-name ".dir-locals.el" (project-root (project-current)))))
>>>
>>> My bet is that that two-liner would go a long way.
>>
>> No, this is not enough.  At the very least I need a history variable to
>> look at the previous configurations.  This feature has to be a thing on
>> top of of `eglot-show-workspace-configuration'.
>
> That idea is the best I can offer for now.  You'd have undo for history,
> which is not bad.  And Git, since it's a file after all.

This command is not really very useful, and if it were it would belong
in files-x.el.





  reply	other threads:[~2023-03-01  7:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 12:49 bug#61868: 29.0.60; Eglot: setting "workspace" configurations should be easier Augusto Stoffel
2023-02-28 19:33 ` João Távora
2023-02-28 20:35   ` Augusto Stoffel
2023-02-28 21:16     ` Augusto Stoffel
2023-03-01  2:02     ` João Távora
2023-03-01  7:39       ` Augusto Stoffel [this message]
2023-03-01 13:20         ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k000x6nf.fsf@gmail.com \
    --to=arstoffel@gmail.com \
    --cc=61868@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).