bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61868: 29.0.60; Eglot: setting "workspace" configurations should be


From: Augusto Stoffel
Subject: bug#61868: 29.0.60; Eglot: setting "workspace" configurations should be easier
Date: Wed, 01 Mar 2023 08:39:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]