[Top][All Lists]

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

Re: Tracking buffer positions across time, without markers (was Re: PL s

From: Clément Pit-Claudel
Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support)
Date: Sat, 9 May 2020 18:22:24 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 09/05/2020 17.38, João Távora wrote:
> On Sat, May 9, 2020 at 8:47 PM Clément Pit-Claudel <address@hidden 
> <mailto:address@hidden>> wrote:
>     Can you clarify what you mean by 'a solved problem'?  
> I meant it in the context of LSP. 
>     One long-standing issue that I've had with Emacs is that I don't know of 
> a way to track buffer positions without adding markers.  Here's a concrete 
> example:
>     I start with a buffer that contains "int foo ()", and send that to a 
> subprocess (say a syntax highlighter, for example).  It returns [0:3:type; 
> 4:7:name].  In the meantime, the user has inserted more text in the buffer, 
> which now contains "static int foo ()".  If I apply the highlighting as-is, 
> it will be all wrong!
> Some idle time after you type, Eglot will inform the LSP server
> that things have changed, and it will reply with more stuff
> to highlight. 
> This is how I interpret this.  It's the way it works with, say syntax
> errors, which are already supported.  I've NOT looked at the spec.
> Did this help?

A bit.  But this works only if the interaction is fast enough, right? (Same for 
syntax errors: positions may well be outdated by the time the errors come back)

reply via email to

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