[Top][All Lists]

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

Re: LSP vs Emacs indentation [Was: bug#64784: 30.0.50; Eglot: Lisp error

From: João Távora
Subject: Re: LSP vs Emacs indentation [Was: bug#64784: 30.0.50; Eglot: Lisp error: (wrong-type-argument number-or-marker-p return) in eglot--post-self-insert-hook]
Date: Sun, 23 Jul 2023 17:42:16 +0100

On Sun, Jul 23, 2023 at 4:13 PM Theodor Thornhill <theo@thornhill.no> wrote:

> This is interesting! But for the time being many lsp-servers vary a lot
> in their ability to do this properly. Gopls, for example, seems to
> handle this very well, in that already has a very heavily enforced
> indentation style. Same goes for rust. Java, however, is a different
> beast. Intellij has its own indentation implementation that isn't
> lsp-available. Eclipse is lsp-available, but was for me almost
> impossible to configure in the initializationOptions, as it required
> sourcing a file with xml-settings etc. Getting jdtls to format things
> like Intellij, which coworkers use, is hard. Similarly, for javascript,
> where other tools, like prettier, is used to do this. Sometimes they
> allow for a plugin to the lsp-server, sometimes it has to be executed
> separately. My point is that getting indentation correct often relies on
> factors outside of lsp, or emacs even, making it hard to
> configure.

So do many other aspects of LSP already.  Uniform configuration isn't
LSP's strong suit.  And as you mention each team/language server
usually has its own underlying rule format and, as you mention,
sometimes it's not even possible  to plug it into LSP.

Eglot users of those subpar language servers can always
opt for good ol Emacs rules using eglot-ignored-server-capabilities
or something else (IMO if a server can't do something well, it
simply shouldn't announce it can, and Eglot can just detect that).

So right now, I'm not really worried about this: I'm more
interested in how well LSP's "format" abstraction meshes
with Emacs's "indent" abstractions.  I want to find out if we
can get a good match in terms of performance and functionality,
and I'm primarily interested in "good" servers (gopls, rust-analyzer,

IOW, I'm calling on Eglot tinkerers to propose and test something
to set indent-* variables to around lines 1870-1950 of
lisp/progmodes/eglot.el :-)


reply via email to

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