unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Theodor Thornhill <theo@thornhill.no>
Cc: Tassilo Horn <tsdh@gnu.org>, Eli Zaretskii <eliz@gnu.org>,
	 Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
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	[thread overview]
Message-ID: <CALDnm505g_Vj5nuO1CpNnuo1cxBdMbVroQ4aoqkpWEQoJr9Z=A@mail.gmail.com> (raw)
In-Reply-To: <87h6pur79c.fsf@thornhill.no>

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,
clangd,...).

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 :-)

João



  reply	other threads:[~2023-07-23 16:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87bkg4bkfu.fsf@fastmail.fm>
     [not found] ` <83a5voa328.fsf@gnu.org>
     [not found]   ` <87h6pw9tpa.fsf@gmail.com>
     [not found]     ` <875y6bm5ut.fsf@fastmail.fm>
2023-07-23 10:20       ` bug#64784: 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] João Távora
2023-07-23 15:13         ` Theodor Thornhill
2023-07-23 16:42           ` João Távora [this message]
2023-07-24 17:03         ` Tassilo Horn
2023-07-24 18:13           ` Theodor Thornhill via Emacs development discussions.
2023-07-27 21:51             ` LSP vs Emacs indentation [ Stephen Leake
2023-07-28  5:28               ` Tassilo Horn
2023-07-28 13:29                 ` Stefan Monnier

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='CALDnm505g_Vj5nuO1CpNnuo1cxBdMbVroQ4aoqkpWEQoJr9Z=A@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=theo@thornhill.no \
    --cc=tsdh@gnu.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 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).