From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#61726: [PATCH] Eglot: Support positionEncoding capability Date: Fri, 24 Feb 2023 13:35:37 +0100 Message-ID: <878rgn9r6u.fsf@gmail.com> References: <87a614g628.fsf@gmail.com> <83cz60r7hu.fsf@gnu.org> <875ybsfvtj.fsf@gmail.com> <831qmgr17p.fsf@gnu.org> <87wn48ecdz.fsf@gmail.com> <83v8jspgnr.fsf@gnu.org> <87lekodxja.fsf@gmail.com> <83a614p4sh.fsf@gnu.org> <87cz60dus9.fsf@gmail.com> <835ybrpnqj.fsf@gnu.org> <87y1oncz09.fsf@gmail.com> <83r0ufo3uc.fsf@gnu.org> <87356vbf0b.fsf@gmail.com> <83pm9znw0i.fsf@gnu.org> <87lekn9ss3.fsf@gmail.com> <83h6vbntqd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29907"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61726@debbugs.gnu.org, joaotavora@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 24 13:36:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1pVXJF-0007b4-GX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 13:36:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVXJ4-000238-4g; Fri, 24 Feb 2023 07:36:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVXJ2-00022w-4A for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 07:36:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVXIw-0007HA-MR for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 07:36:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVXIw-0004Tg-Hp for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 07:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2023 12:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61726 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61726-submit@debbugs.gnu.org id=B61726.167724214917191 (code B ref 61726); Fri, 24 Feb 2023 12:36:02 +0000 Original-Received: (at 61726) by debbugs.gnu.org; 24 Feb 2023 12:35:49 +0000 Original-Received: from localhost ([127.0.0.1]:36235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVXIi-0004TD-M2 for submit@debbugs.gnu.org; Fri, 24 Feb 2023 07:35:48 -0500 Original-Received: from mail-ed1-f47.google.com ([209.85.208.47]:44593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVXIg-0004Sy-Vr for 61726@debbugs.gnu.org; Fri, 24 Feb 2023 07:35:47 -0500 Original-Received: by mail-ed1-f47.google.com with SMTP id s26so54193789edw.11 for <61726@debbugs.gnu.org>; Fri, 24 Feb 2023 04:35:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bv6fR6xgw7VwuCAB+FqtXm+/xCpRW5z/uEX72eImxTU=; b=eOgAqKBrixTel/erAbDLddY0hdjYWU02NpLh1kFpCIoH7bxgc+g/U6L09A/+gvfF8M wDlB6MTEPKdc+f/0YYJNIip1hthF2woBqJF4D9wxr8to+eMyVxvkHpvvU/liicZAO6sb VE9waiupscMWPmhFYhh3b3L+EG9pc1o9Tt+7+XnlKsh0tPxClAaRm/IuAubHFB9kLFdO xeMTchq8crfcwVoi2nsmjP7EYQ7rIzwvx3Ye7qt3FNkcAzLie81lf5qxCbG5X8IvLle4 ZEHq+v1o9rkMGs0/Lh72jBMMtgcDBQDKBcTaWi9uIB8ReU7NdFyhz3Y3CZQECOX/ApGA 4gNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bv6fR6xgw7VwuCAB+FqtXm+/xCpRW5z/uEX72eImxTU=; b=Nmcp5k0DOX8sy7ZLbubGcTFqgZ62pIbx3DmTtS6TD0OSbJHCzEs/9LW3lqumnOYSuv p3OVUUOoIYaK9wg4qm7dCXOH+GFaplxCpXmAzVQNXUBUSGlRTKSbCSdFvnyW2YItSWIk tS7XLSZ+MpZT/WQAtEnVjpEIWqf3ZkUMbZOdGTkR1dsQ0lIOjOpE9v+iYBM3fDzvOqvz a7MqKKEtm0QbRfKto6dd58wpxup9kvG3y+VJ8J1xL/3xr2a3AzgVx2eKdfpJO+Zy26G0 eokvxoxQaLXr+VcPnOhmln4IXOGqy8tixWuUDYsXJvu5XnSrGlcZpEdzzbtNDp1Md9OA SUSQ== X-Gm-Message-State: AO0yUKXVrejHzz5Dk7PwiRgrJyF/Y/5/Io+IxEkwkD9OWsIQ3vQrh8SQ 31lPyDk6iQW60zcThjyU0hJzaKjkpeY= X-Google-Smtp-Source: AK7set/omttZMaoZggEPzZglCg6+RXouKePuLNkyOBCnJbbbzbXq66Wx7+p49fT5H62kE18ltSwz/w== X-Received: by 2002:a17:907:3f2a:b0:8e1:12b6:a8fc with SMTP id hq42-20020a1709073f2a00b008e112b6a8fcmr17875926ejc.4.1677242139704; Fri, 24 Feb 2023 04:35:39 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::6fd0]) by smtp.gmail.com with ESMTPSA id y17-20020a1709064b1100b008b7a9ff7dfdsm8813173eju.162.2023.02.24.04.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 04:35:39 -0800 (PST) In-Reply-To: <83h6vbntqd.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Feb 2023 14:16:58 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256584 Archived-At: On Fri, 24 Feb 2023 at 14:16, Eli Zaretskii wrote: > You assume that the characters that aren't encodable in UTF-8 somehow > invalidate the results produced by the LSP? But that is not > necessarily true, it depends on the context. IOW, this is not the > problem eglot.el should solve, and I'm not sure that signaling an > error is the correct reaction to this situation. It is basically the > problem of the user and/or the major mode. Eglot should do its best > to cope, and leave the rest to the user. You can't even send or receive a message through the JSONRPC channel if it's not valid UTF-8, and `json-serialize' rightfully emits an error. So there's nothing Eglot can do to cope. It also should not, IMO, because we don't know how the server will respond, and we must trust the server when it tell us to do destructive operations like adding or deleting text. > I don't know, and I don't think efficiency is the main concern here. Okay, but Jo=C3=A3o expressed his concerned with efficiency here. > The main concern, from my POV, is exposing the internal representation > of buffer text to the outer world. What if we decide to change the > internal representation at some future date? It already happened, > twice, in Emacs history; it can happen again, even though its > unlikely. Here you have a good point. LSP got into this mess in the first place because of exposure of JavaScript internals.