From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support) Date: Mon, 11 May 2020 16:16:01 +0100 Message-ID: References: <6a2c7d18-344e-fefb-63d5-79a99d0532fc@gmail.com> <942a8cb1-0382-cf83-5ff9-4e776c2660f0@gmail.com> <7f8bdd43-f4d7-e0a8-dcfa-6679215f9d44@gmail.com> <9e98ccbd-6b01-d076-79eb-6bd06ab803fb@gmail.com> <87ftc71g1l.fsf@t510.orion.oneofus.la> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121276"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel To: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 17:17:07 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYAB1-000VRh-GE for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 17:17:07 +0200 Original-Received: from localhost ([::1]:44922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYAB0-0002j8-Dt for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 11:17:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYAAB-00025a-A1 for emacs-devel@gnu.org; Mon, 11 May 2020 11:16:15 -0400 Original-Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:39036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYAAA-0006eI-Ef; Mon, 11 May 2020 11:16:14 -0400 Original-Received: by mail-io1-xd2c.google.com with SMTP id x5so994134ioh.6; Mon, 11 May 2020 08:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=o7g+hOs74CvI0P9T4OVDuiuPW4mdvrvpJmE0VPUiEew=; b=QVL7tDfYCM3VuHwI1IVLOU5EpY+sDRPa5+U0u+tky4dvQ4auvGIQzthJtWmQKfsS/0 NC/5A4kEEpsIYOkU67xOXRvPWW0AKOLR9Yxa0NfdEAsGKFCFRpADi/cTiTTHklMXs/TB mRxmPuav3tAdvwpq6CBKqHgIIxfc8RbusoHaBh0J/XZ1B+ha6Ec4YxaGWYF5AT8Aaw7A 1E2IOJg7the5xfqisHq9jdNFtlV3i2mdQbtfNGbpQnFsWcz6aOeM43NcwAPY4B1wGo3J 5Qyqfov+ZJ5vyFHPEwWIFV1HNlZPljS50sywhKpjg0WWmOyMp1ihbv7iSprQ6q5sXPCv ZaIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=o7g+hOs74CvI0P9T4OVDuiuPW4mdvrvpJmE0VPUiEew=; b=h7r63+ygECkTMCZHWB9SI6c+I0h3TkVhQBetCZoGfo5euCk6Vmjk4R32MfKn6+BJzX VAfILXXfe66Mybx3S0d+jNk9SD66WlPiofc8gejcL5WQFraLSc1v+ZBKj3umYmX5X9Zm 9ojaNwsejygHh29xTPB8hcekpbFM1edpWS+iydYvUEXSBuLTXN/v/JmMadYp4Vsd6NNf V+47URtjQ9OD9PLkZ/xSbP4vT7YheDrzrKkFymkikvitT8C6lLqlsZiQlmLOfddKQdzX 3N0USvHdNFoXebO6lUTezXTodzx2TCJkV9xyNC5afTzhh6VJ2eF1EXRigelS/1jXSfXN fbcA== X-Gm-Message-State: AGi0PuabGW3VCP89vmxi3r+VQ0H2YFMJ/ly6nV1PgWBpK+wtpzD7ziqA sdpMlK5Nvo+4TdvuCD0dfLZd2G1p9AZ8I5w0EBM= X-Google-Smtp-Source: APiQypJsLgKC5fhRPNazmJDWC9uf+gO1MM8iO1aFvaqqNMusvuyCQSQQxobpHCEuVm+3Utd2V7x3CESg5Dito1TCGYE= X-Received: by 2002:a05:6638:68f:: with SMTP id i15mr16007933jab.136.1589210172851; Mon, 11 May 2020 08:16:12 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d2c; envelope-from=joaotavora@gmail.com; helo=mail-io1-xd2c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_EXCESS_BASE64=0.979, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249799 Archived-At: On Mon, May 11, 2020 at 3:18 PM Cl=C3=A9ment Pit-Claudel wrote: > Yes, eactly, that's what I meant when I wrote "Visual Studio has a nice A= PI for this: there is a way to snapshot a buffer, and to translate position= s between two snapshots. In my example, this allows you to translate 0:3 i= n 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=C3=A3o