[Top][All Lists]

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

Re: CC Mode and electric-pair "problem".

From: Clément Pit-Claudel
Subject: Re: CC Mode and electric-pair "problem".
Date: Wed, 20 Jun 2018 09:48:43 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 2018-06-19 02:38, Stefan Monnier wrote:
> It's easier to highlight the unmatched opener than to try and prevent
> the second line from being highlighted (and you want to highlight that
> opener in any case).

Maybe, but I find it much more pleasant if the second line isn't highlighted.

> Not sure what you mean by "bail out".  Point 1 has added highlighting to
> warn the user about the presence of a problem.  Short of changing the
> actual code behind the user's back, there's really not much more we can
> do to prevent the compiler/IDE from seeing that broken code.

We want the compiler and IDE to see the broken code, but we also want to do as 
much as we can to make the experience pleasant (and I find it unpleasant that 
inserting an unmatched '"' breaks syntax highlighting for the rest of the 

As an example, Merlin does a great job at handling broken OCaml code.

> Point 2 suggest to go with the simplest implementation (i.e. let the
> behavior be dictated by the implementation), so if your highlighting is
> provided by LSP (say), then point 2 would suggest that there's no point
> trying to provide a different behavior from the one provided by the
> LSP server.

Yes, I agree.  In the meantime, approximating that at the cost of a bit 
complexity in the Emacs mode seems good.


reply via email to

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