GNU logs - #62315, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62315: 30.0.50; [BUG] Rust eglot tuple struct field completion
Resent-From: Ruijie Yu <ruijie@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 21 Mar 2023 03:01:02 +0000
Resent-Message-ID: <handler.62315.B.16793676612014 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 62315
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 62315 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.16793676612014
          (code B ref -1); Tue, 21 Mar 2023 03:01:02 +0000
Received: (at submit) by debbugs.gnu.org; 21 Mar 2023 03:01:01 +0000
Received: from localhost ([127.0.0.1]:57264 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1peSFA-0000WP-Ky
	for submit <at> debbugs.gnu.org; Mon, 20 Mar 2023 23:01:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:46728)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1peSF8-0000WF-4r
 for submit <at> debbugs.gnu.org; Mon, 20 Mar 2023 23:00:58 -0400
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 <ruijie@HIDDEN>) id 1peSF7-0005Id-N8
 for bug-gnu-emacs@HIDDEN; Mon, 20 Mar 2023 23:00:57 -0400
Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ruijie@HIDDEN>) id 1peSF5-0007TS-Nz
 for bug-gnu-emacs@HIDDEN; Mon, 20 Mar 2023 23:00:57 -0400
Received: from fw.net.yu.netyu.xyz (<unknown> [222.248.4.98])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id d5be1753
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <bug-gnu-emacs@HIDDEN>;
 Tue, 21 Mar 2023 03:00:46 +0000 (UTC)
User-agent: mu4e 1.8.14; emacs 30.0.50
From: Ruijie Yu <ruijie@HIDDEN>
Date: Tue, 21 Mar 2023 10:33:48 +0800
Message-ID: <sdvo7omvmey.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@HIDDEN;
 helo=mail.netyu.xyz
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.6 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

I can't word it, so let me explain via an example.  The Emacs in
question was built a few days ago, FTR.

Also, note that I am using rust-ts-mode as the major mode, since
it is the only builtin rust major mode, with the corresponding grammar
lib cloned and built moments ago.

$ cd "$(mktemp -d)"
$ cargo init --name foo --lib
$ emacs -Q src/lib.rs

Replace src/lib.rs with the following content, then revert buffer and
run `eglot':

--8<---------------cut here---------------start------------->8---
//  -*- mode: rust-ts; -*-
/// 0..=10
#[derive(Default)]
struct Foo(u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32);

fn foo(f: Foo) -> u32 {
    f.
}
--8<---------------cut here---------------end--------------->8---

Put point after "f.", and type any number between (inclusive) 0 and 10,
and type TAB.  Observe that the number is repeated.  This even happens
with 1, where I expect to have "10" as a completion candidate.

I use a rather large tuple struct in this example because I want to
demonstrate that this issue should be happening for all magnitude of
tuple indices, not just a single digit.

--8<---------------cut here---------------start------------->8---
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.17.8) of 2023-03-11 built on fw.net.yu
Repository revision: c6bfffa9fe1af7f4f806e5533ba5f3c33476cf9a
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --with-pgtk'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: Rust

Minor modes in effect:
  eglot-inlay-hints-mode: t
  eglot--managed-mode: t
  flymake-mode: t
  text-scale-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils time-date cl-extra eglot external-completion array
filenotify jsonrpc ert pp ewoc debug backtrace find-func xref
flymake-proc flymake warnings icons compile text-property-search comint
ansi-osc ansi-color ring url-util url-parse auth-source eieio eieio-core
cl-macs password-cache json subr-x map url-vars project byte-opt gv
bytecomp byte-compile imenu pcase rust-ts-mode rx c-ts-common treesit
cl-seq thingatpt help-fns radix-tree help-mode files-x format-spec
face-remap vc-git diff-mode easy-mmode vc-dispatcher cl-loaddefs cl-lib
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process
emacs)
--8<---------------cut here---------------end--------------->8---

--
Best,


RY




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Ruijie Yu <ruijie@HIDDEN>
Subject: bug#62315: Acknowledgement (30.0.50; [BUG] Rust eglot tuple
 struct field completion)
Message-ID: <handler.62315.B.16793676612014.ack <at> debbugs.gnu.org>
References: <sdvo7omvmey.fsf@HIDDEN>
X-Gnu-PR-Message: ack 62315
X-Gnu-PR-Package: emacs
Reply-To: 62315 <at> debbugs.gnu.org
Date: Tue, 21 Mar 2023 03:01:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 62315 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
62315: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62315
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62315: 30.0.50; [BUG] Rust eglot tuple struct field completion
Resent-From: Ruijie Yu <ruijie@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 22 Mar 2023 05:14:01 +0000
Resent-Message-ID: <handler.62315.B62315.167946203732734 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62315
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 62315 <at> debbugs.gnu.org
Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= <joaotavora@HIDDEN>
Received: via spool by 62315-submit <at> debbugs.gnu.org id=B62315.167946203732734
          (code B ref 62315); Wed, 22 Mar 2023 05:14:01 +0000
Received: (at 62315) by debbugs.gnu.org; 22 Mar 2023 05:13:57 +0000
Received: from localhost ([127.0.0.1]:33221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1peqnN-0008Vr-1X
	for submit <at> debbugs.gnu.org; Wed, 22 Mar 2023 01:13:57 -0400
Received: from netyu.xyz ([152.44.41.246]:60716 helo=mail.netyu.xyz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1peqnL-0008Vj-B7
 for 62315 <at> debbugs.gnu.org; Wed, 22 Mar 2023 01:13:56 -0400
Received: from fw.net.yu.netyu.xyz (<unknown> [222.248.4.98])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id 6aaf373a
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Wed, 22 Mar 2023 05:13:53 +0000 (UTC)
References: <sdvo7omvmey.fsf@HIDDEN>
User-agent: mu4e 1.8.14; emacs 30.0.50
From: Ruijie Yu <ruijie@HIDDEN>
Date: Wed, 22 Mar 2023 13:11:14 +0800
In-reply-to: <sdvo7omvmey.fsf@HIDDEN>
Message-ID: <sdvjzz9v053.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)


CC'ing Jo=C3=A3o because eglot.  Thanks.

> I can't word it, so let me explain via an example.  The Emacs in
> question was built a few days ago, FTR.
>
> Also, note that I am using rust-ts-mode as the major mode, since
> it is the only builtin rust major mode, with the corresponding grammar
> lib cloned and built moments ago.
>
> $ cd "$(mktemp -d)"
> $ cargo init --name foo --lib
> $ emacs -Q src/lib.rs
>
> Replace src/lib.rs with the following content, then revert buffer and
> run `eglot':
>
> //  -*- mode: rust-ts; -*-
> /// 0..=3D10
> #[derive(Default)]
> struct Foo(u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32);
>
> fn foo(f: Foo) -> u32 {
>     f.
> }
>
>
> Put point after "f.", and type any number between (inclusive) 0 and 10,
> and type TAB.  Observe that the number is repeated.  This even happens
> with 1, where I expect to have "10" as a completion candidate.
>
> I use a rather large tuple struct in this example because I want to
> demonstrate that this issue should be happening for all magnitude of
> tuple indices, not just a single digit.
>
> In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.37, cairo version 1.17.8) of 2023-03-11 built on fw.net.yu
> Repository revision: c6bfffa9fe1af7f4f806e5533ba5f3c33476cf9a
> Repository branch: master
> System Description: Arch Linux
>
> Configured using:
>  'configure --with-pgtk'
>
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
> JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK
> PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
> TREE_SITTER WEBP XIM GTK3 ZLIB
>
> Important settings:
>   value of $LANG: en_US.UTF-8
>   value of $XMODIFIERS: @im=3Dfcitx
>   locale-coding-system: utf-8-unix
>
> Major mode: Rust
>
> Minor modes in effect:
>   eglot-inlay-hints-mode: t
>   eglot--managed-mode: t
>   flymake-mode: t
>   text-scale-mode: t
>   tooltip-mode: t
>   global-eldoc-mode: t
>   eldoc-mode: t
>   show-paren-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   tool-bar-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   blink-cursor-mode: t
>   line-number-mode: t
>   transient-mark-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
>
> Load-path shadows:
> None found.
>
> Features:
> (shadow sort mail-extr emacsbug message mailcap yank-media puny dired
> dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
> gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
> gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
> mail-prsvr mail-utils time-date cl-extra eglot external-completion array
> filenotify jsonrpc ert pp ewoc debug backtrace find-func xref
> flymake-proc flymake warnings icons compile text-property-search comint
> ansi-osc ansi-color ring url-util url-parse auth-source eieio eieio-core
> cl-macs password-cache json subr-x map url-vars project byte-opt gv
> bytecomp byte-compile imenu pcase rust-ts-mode rx c-ts-common treesit
> cl-seq thingatpt help-fns radix-tree help-mode files-x format-spec
> face-remap vc-git diff-mode easy-mmode vc-dispatcher cl-loaddefs cl-lib
> rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
> vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
> term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe
> tabulated-list replace newcomment text-mode lisp-mode prog-mode register
> page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
> scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
> frame minibuffer nadvice seq simple cl-generic indonesian philippine
> cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
> korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
> european ethiopic indian cyrillic chinese composite emoji-zwj charscript
> charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
> cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
> files window text-properties overlay sha1 md5 base64 format env
> code-pages mule custom widget keymap hashtable-print-readable backquote
> threads dbusbind inotify dynamic-setting system-font-setting
> font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process
> emacs)


--
Best,


RY




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62315: 30.0.50; [BUG] Rust eglot tuple struct field completion
Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= <joaotavora@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 22 Mar 2023 10:36:01 +0000
Resent-Message-ID: <handler.62315.B62315.16794813581551 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62315
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Ruijie Yu <ruijie@HIDDEN>
Cc: 62315 <at> debbugs.gnu.org
Received: via spool by 62315-submit <at> debbugs.gnu.org id=B62315.16794813581551
          (code B ref 62315); Wed, 22 Mar 2023 10:36:01 +0000
Received: (at 62315) by debbugs.gnu.org; 22 Mar 2023 10:35:58 +0000
Received: from localhost ([127.0.0.1]:33612 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pevoz-0000Ow-FE
	for submit <at> debbugs.gnu.org; Wed, 22 Mar 2023 06:35:57 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:46021)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1pevox-0000Ob-5u
 for 62315 <at> debbugs.gnu.org; Wed, 22 Mar 2023 06:35:55 -0400
Received: by mail-wr1-f51.google.com with SMTP id v25so13006925wra.12
 for <62315 <at> debbugs.gnu.org>; Wed, 22 Mar 2023 03:35:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679481349;
 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=ucgbgQQk1wCKWjOtvd9hXMLufbI6dYNbEYcsOHWIqkM=;
 b=HnILL4Big6oj97Q8Pn5pDFFxafw8zzuvZliKCQY+MVDcgPi52ICv0yHVszfq1SHwdl
 tfyZM+1MojyUJONi0tg8On4gY1IGu6EexxP9MU+MnT7ekXVQ5YOTUYudQEP+M36EL8a5
 W6ww7XnFjbyo5sWMfpYRg1mCdTShSwStG+hzO3zihsMmDJh7+MyEhrVVJPJf5+tZFSOh
 1QYz4XQVJJsS9wUE5mrIO4vTSekHvwnJxXe6sLj8SUBbpa7Mv85oKb4HjmcZN/W1MrBb
 u57I9iwGBnKNmVGsAoC5IVnpSyBtH8xXxjStTlNpqI9DX0f32qtUIfP1Fukoqv/zHS+l
 WiPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679481349;
 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=ucgbgQQk1wCKWjOtvd9hXMLufbI6dYNbEYcsOHWIqkM=;
 b=JBcgc05R+w5aME0lgQNb5SptFFRcEVQewebI8/g5Gab5Fz20BMxKy5tQiDhuRkBw6c
 4Al4Lcavy88V4qvCzC8RpailgaQxbab3ZekOkpOm2YrhcQf5a5Fk8NpQ0VctuddK91qc
 VV4Ioi8+vEuj+nqZIifWe5KW3J8/GcfzgGCzVhj37rrubznGuJSHl2tsPO1l9yWT+kez
 1K7a/89rDheTHIxoislMO5OvHK/mLGWHrvcPPGkh2FHPwzYT/B7nDVyQ5LgniYQBWutb
 qA+mv39AjnKKPqRPysx7GHjjKYaHseg+rqlI7QWHwTdcadIoD9My9+3ZLzWfClTb8q/M
 KLDw==
X-Gm-Message-State: AO0yUKUZ4YVGzPThQS4NPwAVkWlhDxd7n2HMh7HoPkc1eA6VrG42q3/F
 79EPhIXHvDuDixt6paYWxE+Ab/5XCCc=
X-Google-Smtp-Source: AK7set+f5S9ksbrogQBaWj3nW4/5qDbBlpGrIIBlmTwMufm4Sm7QTt/VegpgzuIixb0EEmRHJXzIlQ==
X-Received: by 2002:a5d:5042:0:b0:2da:1ac3:adfc with SMTP id
 h2-20020a5d5042000000b002da1ac3adfcmr2548775wrt.60.1679481348700; 
 Wed, 22 Mar 2023 03:35:48 -0700 (PDT)
Received: from krug (87-196-72-142.net.novis.pt. [87.196.72.142])
 by smtp.gmail.com with ESMTPSA id
 p14-20020a5d48ce000000b002d45575643esm11487996wrs.43.2023.03.22.03.35.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 22 Mar 2023 03:35:48 -0700 (PDT)
From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= <joaotavora@HIDDEN>
In-Reply-To: <sdvjzz9v053.fsf@HIDDEN> (Ruijie Yu's message of "Wed, 22 Mar
 2023 13:11:14 +0800")
References: <sdvo7omvmey.fsf@HIDDEN> <sdvjzz9v053.fsf@HIDDEN>
Date: Wed, 22 Mar 2023 10:37:49 +0000
Message-ID: <878rfpvzpe.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ruijie Yu <ruijie@HIDDEN> writes:

> CC'ing Jo=C3=A3o because eglot.  Thanks.
>
>> I can't word it, so let me explain via an example.  The Emacs in
>> question was built a few days ago, FTR.
>>
>> Also, note that I am using rust-ts-mode as the major mode, since
>> it is the only builtin rust major mode, with the corresponding grammar
>> lib cloned and built moments ago.
>>
>> $ cd "$(mktemp -d)"
>> $ cargo init --name foo --lib
>> $ emacs -Q src/lib.rs
>>
>> Replace src/lib.rs with the following content, then revert buffer and
>> run `eglot':
>>
>> //  -*- mode: rust-ts; -*-
>> /// 0..=3D10
>> #[derive(Default)]
>> struct Foo(u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32);
>>
>> fn foo(f: Foo) -> u32 {
>>     f.
>> }
>>
>>
>> Put point after "f.", and type any number between (inclusive) 0 and 10,
>> and type TAB.=20=20

Hi, I could reproduce this, if instead of TAB I type M-TAB (or the
equivalent C-M-i, both run completion-at-point).  Rust-rs-mode is not
needed (rust-mode from ELPA is the same).

I'm not sure yet this isn't a server bug.  After typing the 1, but
before C-M-i, the line reads:

    f.1

Point is now in LSP position (:line 6 :character 7).  After C-M-i, the
interaction with the server is:

    [client-request] (id:6) Wed Mar 22 10:17:53 2023:
    (:jsonrpc "2.0" :id 6 :method "textDocument/completion" :params
              (:textDocument (:uri "file:///tmp/tmp.wLa6UWw1Nf/src/lib.rs")
               :position (:line 6 :character 7)
               :context (:triggerKind 1)))
    [server-reply] (id:6) Wed Mar 22 10:17:53 2023:
    (:jsonrpc "2.0" :id 6 :result
              (:isIncomplete t :items
                             [(:label "0" :kind 5 :detail "u32" :filterText=
 "0"
                                          :textEdit (:range (:start (:line =
6 :character 7)
                                                             :end (:line 6 =
:character 7))
                                                     :newText "0"))
                              (:label "1" :kind 5 :detail "u32" :filterText=
 "1"
                                          :textEdit (:range (:start (:line =
6 :character 7)
                                                             :end (:line 6 =
:character 7))
                                                     :newText "1"))

   (some elements elided for readability)

Which means the server is offering to _insert_ an _additional_ '0', '1'
etc at position 7.=20=20

Emacs/Eglot is not doing the right thing, but I don't think the server
is doing the right thing either.

Probably the server should be saying "I don't have completions for this
position given my current view of the document".  Maybe this could be
reported to the rust-analyzer people for their input.

However, given this "faulty" server exchange, I'm inclined to say
completion-at-point should offer to insert '0','1', and other
completions, and not immediately insert the "1".

Jo=C3=A3o





Last modified: Wed, 22 Mar 2023 10:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.