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 17:39:11 +0100 Message-ID: <87k00781cg.fsf@gmail.com> References: <87a614g628.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> <878rgn9r6u.fsf@gmail.com> <83edqfnq5u.fsf@gnu.org> <83bkljnpck.fsf@gnu.org> <874jrb9l6d.fsf@gmail.com> <834jrbnlaf.fsf@gnu.org> <87v8jr83ic.fsf@gmail.com> <83v8jrm4r0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3825"; 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 17:40:06 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 1pVb78-0000oF-Gd for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 17:40:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVb75-0004fj-Qz; Fri, 24 Feb 2023 11:40:03 -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 1pVb74-0004dt-Jk for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 11:40:02 -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 1pVb74-0004Sn-9b for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 11:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVb74-0003Bj-1x for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 11:40: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 16:40: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.167725676112200 (code B ref 61726); Fri, 24 Feb 2023 16:40:02 +0000 Original-Received: (at 61726) by debbugs.gnu.org; 24 Feb 2023 16:39:21 +0000 Original-Received: from localhost ([127.0.0.1]:38088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVb6P-0003Ah-Fh for submit@debbugs.gnu.org; Fri, 24 Feb 2023 11:39:21 -0500 Original-Received: from mail-ed1-f51.google.com ([209.85.208.51]:36518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVb6N-0003AW-Qu for 61726@debbugs.gnu.org; Fri, 24 Feb 2023 11:39:20 -0500 Original-Received: by mail-ed1-f51.google.com with SMTP id da10so58289677edb.3 for <61726@debbugs.gnu.org>; Fri, 24 Feb 2023 08:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=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=yoEhUI8STSrMwOpD1IDt2KLrwLn2umbBH618jVFvhmc=; b=StsJ+Dpmw4hpGK4JScxC7pfMC3EBwSG2neEeULvL5mwMY32TBIwGzuJfvdyIc/JgSQ 85j5j+p/OYZovBMLUowYa9Y0hVeuW4P4FtpYtThkFGtptyBrPblUE8mi2ld70A7cWIw1 so/W4VLNJe/6t1qNSICkcyySNee5GqBkDikHiRK12mHrlxbTcWWqm+BWf2Y0b+OrW7V4 u2tQyWCnbjoKoA1Rk+Rf7xvVpcLViAaka0X+QSk8+2LllRbVAqTgATNYss8aUD2btOG3 rZADwg+f3Qr07Kp0tyKbsArFT4jQjVs4kuZqR2wt6XrPhBRQAFCiqm7eVM6k9ZyU48Aj sk2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=yoEhUI8STSrMwOpD1IDt2KLrwLn2umbBH618jVFvhmc=; b=kCaEZV+nQXZFUjGU1pYO196NBKM4eIhIl0SX1SkF2LO1rSQScZmGcbCby3/CBHppA4 Y0JE9Y7k+bJN7ovCsbe5gZK02GXyPW+DmdFQgwiZEINvifF0Dv9igIOAggsjIocKn9JL MZVfVGbvHml3TAZeuIKsfz4kW0x9fB+YBJHM43SDC018AHNksEOGaertatTtDlxqdKCu oB94clKsGj+fHpupDOv5RNe1IpBHsOrc00Uh944sv+GeQMk7Xc8MOUV0CQaKIDqt5AEr bKz56qxtPUndnGAys9Is1QMNWVdLqIzAsIbLG4ELziySFHV6gY+0+AeN9HjrYyp2gL9U 7vvQ== X-Gm-Message-State: AO0yUKWPIYRuEknl0VGG+xfmDe7nelvZxZJgXemyJXRX/ttD/sXUdYdP Z4vKVH7Cg0wMtMLyMPnEm97DueDPdWo= X-Google-Smtp-Source: AK7set9ZYRhOd8RAaQ0EGY3zZ85HKc9zRLv4FOIyKJm/KPCx6xJxFR91mD1IbsCzWiodN3r4Zv5H8A== X-Received: by 2002:a17:906:ecf9:b0:8c0:6422:e0c2 with SMTP id qt25-20020a170906ecf900b008c06422e0c2mr18816297ejb.22.1677256753536; Fri, 24 Feb 2023 08:39:13 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::6fd0]) by smtp.gmail.com with ESMTPSA id me19-20020a170906aed300b008b17662e1f7sm10470607ejb.53.2023.02.24.08.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 08:39:12 -0800 (PST) In-Reply-To: <83v8jrm4r0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Feb 2023 18:01:55 +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:256633 Archived-At: On Fri, 24 Feb 2023 at 18:01, Eli Zaretskii wrote: >> From: Augusto Stoffel >> Cc: joaotavora@gmail.com, 61726@debbugs.gnu.org >> Date: Fri, 24 Feb 2023 16:52:27 +0100 >> >> > abcde xyz >> > >> > where the \201 byte was replaced by the SPC character. The latter >> > string is, of course, perfectly correct UTF-8 sequence, and so doesn't >> > violate any specs. >> > >> > The SPC character as a replacement is, of course, just one example. >> > We could instead use '?' or U+FFFD REPLACEMENT CHARACTER, or anything >> > else, and all of those replacements can be encoded in UTF-8 without >> > any problems. >> > >> > Did I make myself clear now? >> >> You made yourself clear the first time. What I don't understand is, why >> do you think this is a good idea, because in my view it clearly isn't. >> >> So suppose we lie about the buffer content and say it's "abcde xyz". >> Then the server sends a diagnostic saying "found unexpected space >> character at column 6". What sense does it make to the user? > > How can that happen? Raw bytes can be in comments and in strings, and > basically nowhere else in a program. How would the server decide that > a space is not valid in these contexts? > >> Even worse, imagine we then request instructions to reformat the buffer. >> Suppose that the replacement "abcde xyz" -> "abcde\nxyz" is meaningful >> in our language but the replacement "abcde\201xyz" -> "abcde\nxyz" is >> dangerous. Do we want to get into this kind of trouble? > > "Dangerous" in what way? If someone thinks this is a good and useful feature, of course they could work on it. I think the current behavior (json-serialize error) is better because it sticks to the letter of the specs. My point of view is very straightforward: you can have language servers; you can have arbitrary bytes in your files and buffers; but you can't always have both. But I'm sure I've already communicated this, sorry for the repetition.