|
From: | JD Smith |
Subject: | Re: User experience: eglot configuration |
Date: | Fri, 31 Jan 2025 07:34:51 -0500 |
Eglot does have the ability to set eglot-workspace-configuration to a function, which provides tremendous flexibility in configuring multiple different servers based on project, file path, host, or any other criteria. This is a real time saver vs. maintaining server-specific config files in each project. But it is challenging to configure, for sure. Every server has its own specific configuration hierarchy. I'm agnostics on whether JSON or LISP would be a preferred syntax, but there are also some oddities in eglot's workspace implementation that make it very challenging to arrive at a valid config. For example, to configure pyright's "stubPath" setting, you note from its docs the following setting:
and not, as you'd expect: I.e. it requires an arbitrary break in the nesting hierarchy from JSON -> eglot plists. Basically no one can stumble on this themselves starting from the pyright+eglot docs. Maybe it's a bug, or maybe it's specific to this language server. But surely some fraction of users encounter this and just walk away. Perhaps what's needed is one layer of abstraction above eglot-workspace-configuration, aimed at major-mode authors, so they can provide "common settings" for various popular servers in a convenient place. Users can of the mode can then simply select/configure the desired settings (e.g. with Customize). Under the hood, this would map onto an eglot-workspace-configuration function which would do the necessary translations for sending the desired configuration over the wire. Ideally this would be in the form of a simple API would could be used in your own workspace-configuration function, for advanced users who want to "graduate" to that. |
[Prev in Thread] | Current Thread | [Next in Thread] |