[Top][All Lists]

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

Re: c-ts-mode

From: João Távora
Subject: Re: c-ts-mode
Date: Fri, 8 Sep 2023 16:56:20 +0100

On Fri, Sep 8, 2023 at 4:34 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: João Távora <joaotavora@gmail.com>
> > Date: Fri, 8 Sep 2023 16:15:09 +0100
> > Cc: theo@thornhill.no, casouri@gmail.com, spacibba@aol.com,
> >       emacs-devel@gnu.org
> >
> > > > I guess this means we should add a TODO item for supporting such
> > > > external specifications?
> > >
> > > Done; patches welcome.
> >
> > I couldn't find your TODO item (in etc/TODO at least).
> Chrystal ball says you looked on master.  I made my change on the
> emacs-29 branch instead.

Ah yes.

> I think we should try to support this without LSP servers.

OK, but then you'll have to deal with the abstraction problem which
is being solved by LSP servers at the moment, quite effectively.
It's fine to want this but the motivation you'll find
for working on this item is affected  That's because that "minimum
command" you mention already exists in practice

Are you aware of eslint, prettier, gofmt, rustfmt, and whatever
other formatter programs are out there?    Or do you just want
to support clang-format for the Emacs project and other C/C++

Also I'm not sure that formatters for some languages aren't
exclusively LSP.

Anyway, do you also want to support this without external tools
at all  (i.e. without relying on the clang-format program at all?)
Your TODO item seems to say so.

If so, then going that route means basically writing a translator
of clang-format -> Emacs treesitter rules.  Maybe it's easier than
I think, and the main advantage is it will plug into
indent-line-function and indent-region-function rather easily.
And, who knows, some code can be reused for writing translators of
other formatters.

Anyway I wouldn't discard the "LSP shortcut" idea.


reply via email to

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