From: "João Távora" <joaotavora@gmail.com>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support)
Date: Mon, 11 May 2020 16:16:01 +0100 [thread overview]
Message-ID: <CALDnm53ErGxY+ffYLz616Hupe6_gRE+kPZrb6AO9xCMjkvLAtw@mail.gmail.com> (raw)
In-Reply-To: <a1263512-e737-49bc-f968-c6144463b5f3@gmail.com>
On Mon, May 11, 2020 at 3:18 PM Clément Pit-Claudel
<cpitclaudel@gmail.com> 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.
João
next prev parent reply other threads:[~2020-05-11 15:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-09 19:47 Tracking buffer positions across time, without markers (was Re: PL support) Clément Pit-Claudel
2020-05-09 21:38 ` João Távora
2020-05-09 22:22 ` Clément Pit-Claudel
2020-05-09 23:26 ` João Távora
2020-05-10 3:45 ` Clément Pit-Claudel
2020-05-10 4:32 ` Eli Zaretskii
2020-05-10 19:27 ` Clément Pit-Claudel
2020-05-10 19:42 ` Drew Adams
2020-05-10 19:49 ` Eli Zaretskii
2020-05-10 20:52 ` Clément Pit-Claudel
2020-05-11 14:24 ` Eli Zaretskii
2020-05-11 15:03 ` Clément Pit-Claudel
2020-05-11 15:25 ` Stefan Monnier
2020-05-10 20:46 ` Stefan Monnier
2020-05-11 2:27 ` Eli Zaretskii
2020-05-11 3:19 ` Stefan Monnier
2020-05-11 0:17 ` Vladimir Sedach
2020-05-11 14:18 ` Clément Pit-Claudel
2020-05-11 15:16 ` João Távora [this message]
2020-05-11 15:33 ` Clément Pit-Claudel
2020-05-11 15:44 ` João Távora
2020-05-11 16:02 ` Clément Pit-Claudel
2020-05-11 16:11 ` João Távora
2020-05-11 17:20 ` Stefan Monnier
2020-05-11 14:39 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALDnm53ErGxY+ffYLz616Hupe6_gRE+kPZrb6AO9xCMjkvLAtw@mail.gmail.com \
--to=joaotavora@gmail.com \
--cc=cpitclaudel@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.