[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: João Távora
Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support)
Date: Mon, 11 May 2020 16:16:01 +0100

On Mon, May 11, 2020 at 3:18 PM Clément Pit-Claudel
<address@hidden> wrote:

> Yes, eactly, that's what I meant when I wrote "Visual Studio has a nice API 
> for this: there is a way to snapshot a buffer, and to translate positions 
> between two snapshots.  In my example, this allows you to translate 0:3 in 
> the original buffer to 7:10 in the new one."

Well, if I understand correctly, you can still do this with markers.
You just need to register, somehow, somewher, at the time you
make the request  to the  server that "3" means "that marker there".
Then recover this  information. In the worse case, this means this
means a table of markers that is as the number of positions in the
buffer, which is probably a performance no-no :-(

But if you could know in advance that the server would only return
things for a specific region, or only a subset of positions within that
region, then the costs could be reduced drastically.

By the way the way LSP deals with this is by not fixing it. It temporarily
misaligns the syntax errors.  But that's because it doesn't take 1 minute
to syntax-check :-), rather around 1 second or so in the common cases.


reply via email to

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