emacs-devel
[Top][All Lists]
Advanced

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

Re: cc-mode fontification feels random


From: Eli Zaretskii
Subject: Re: cc-mode fontification feels random
Date: Sat, 05 Jun 2021 20:32:37 +0300

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Sat, 05 Jun 2021 19:08:13 +0200
> 
> If we are going to really modernize Emacs' programming language support
> we need to provide more than parser-based syntax highlighting and
> indentation. We need smart code completion, code hints, transformations,
> etc.

Yes, we need that, and much more.  But if we reject partial solutions
because they aren't 110% perfect with every PL out there, we get to
stay with what we have now, which is much worse.  So in my book
incremental improvements using contemporary technology are a win, even
if they don't get us all the way to the ultimate goal.  Let's not
discourage potential volunteers from taking up the job of bringing
stuff like tree-sitter to Emacs because it may not be perfect for some
demanding languages.

> That means we need something like LSP.

We need to try both these technologies, before we make the decision.
Each one of them has upsides and downsides, and it is therefore
unwise, IMO, to put all the eggs into a single basket.  Chances are we
will want to keep both solutions handy, because they can be
complementary.

> Tree-sitter migth be useful for the languages not yet supported by
> LSP, though (but, if I got it right, tree-sitter is implemented on
> Javascript, so it requires a JS engine to work, maybe too much of a
> dependency for something that doesn't add that much over what we
> have now.)

That's secondary, IMO.  If the main issues are solved satisfactorily,
I don't expect too much time to pass before someone comes up with a
way of producing the tree-sitter grammars in Emacs Lisp.

> > I think you'd expect a good LSP server to "degrade gracefully" and still
> > provide good info for indentation and syntax highlighting even if you
> > only have the one file and all the other files in the project
> > are missing.
> 
> As already mentioned elsewhere on this thread, an LSP server with access
> to just the current file is severely handicapped. One thing is to miss
> the information about some functions yet-to-be-written and another thing
> entirely is to ignore everything not defined on the current file.

Once again, my suggestion is not to require perfect solutions,
especially since what we have now is nowhere near perfection.



reply via email to

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