From unknown Fri Jun 20 05:26:18 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#68699 <68699@debbugs.gnu.org> To: bug#68699 <68699@debbugs.gnu.org> Subject: Status: Eglot completion has stopped working in some cases Reply-To: bug#68699 <68699@debbugs.gnu.org> Date: Fri, 20 Jun 2025 12:26:18 +0000 retitle 68699 Eglot completion has stopped working in some cases reassign 68699 emacs submitter 68699 Brennan Vincent severity 68699 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 24 15:37:47 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 20:37:47 +0000 Received: from localhost ([127.0.0.1]:46700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSk0I-000389-TI for submit@debbugs.gnu.org; Wed, 24 Jan 2024 15:37:47 -0500 Received: from lists.gnu.org ([2001:470:142::17]:48548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSk0F-00037v-W9 for submit@debbugs.gnu.org; Wed, 24 Jan 2024 15:37:44 -0500 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 1rSk03-0004Xx-Gl for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 15:37:33 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSk01-0007DO-DE for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 15:37:31 -0500 Received: from localhost ([173.205.212.102]) by smtp.umanwizard.com ; 24 Jan 2024 20:37:23 +0000 X-Fes-Received-For: bug-gnu-emacs@gnu.org X-Fes-Received-From: From: Brennan Vincent To: bug-gnu-emacs@gnu.org, =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Eglot completion has stopped working in some cases Date: Wed, 24 Jan 2024 15:37:19 -0500 Message-ID: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com 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_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) I bisected the issue to e93d99a4a0ce578249304dce350465c580a49892, so including Jo=C3=A3o. In some cases when attempting to complete using eglot, I am getting errors rather than a list of completions. I haven't been able to debug why but it seems to be happening in "pcm" completion style. For example, in a Rust crate with the following main file: fn foo_len() { } fn main() { len } positioning my cursor after "len" and attempting completion yields the following error message: completion-pcm--merge-completions: Internal error: _mm_blend_epi16(=E2=80= =A6) (use std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \`len Full backtrace: Debugger entered--Lisp error: (error #("Internal error: _mm_blend_epi16(=E2= =80=A6) (use std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \\`l= en" 16 17 (eglot--lsp-item (:label #("_mm_blend_epi16(=E2=80=A6) (use std::= arch::x86_64::_mm_blend_epi16)" 0 1 (eglot--lsp-item #5) 5 8 (face completi= ons-common-part)) :kind 3 :detail "unsafe fn(__m128i, __m128i) -> __m128i" = :documentation (:kind "markdown" :value "Blend packed 16-bit integers from = `a` and `b` using the mask `IMM8`.\n\nThe mask bits determine the selection= . A clear bit selects the\ncorresponding element of `a`, and a set bit the = corresponding\nelement of `b`.\n\n[Intel's documentation](https://www.intel= .com/content/www/us/en/docs/intrinsics-guide/index.html#text=3D_mm_blend_ep= i16)") :deprecated :json-false :sortText "fffffff0" :filterText #("_mm_blen= d_epi16" 5 8 (face completions-common-part)) :insertTextFormat 2 :textEdit = (:range (:start (:line 4 :character 4) :end (:line 4 :character 7)) :newTex= t "_mm_blend_epi16(${1:a}, ${2:b})$0") :additionalTextEdits [] :command (:t= itle "triggerParameterHints" :command "rust-analyzer.triggerParameterHints"= ) :data (:position (:textDocument (:uri "file:///home/brennan/test_rust/src= /bin/test_rust.rs") :position (:line 4 :character 7)) :imports [(:full_impo= rt_path "std::arch::x86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi1= 6")]))) 21 24 (face completions-common-part))) signal(error (#("Internal error: _mm_blend_epi16(=E2=80=A6) (use std::arc= h::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \\`len" 16 17 (eglot--lsp= -item (:label #("_mm_blend_epi16(=E2=80=A6) (use std::arch::x86_64::_mm_ble= nd_epi16)" 0 1 (eglot--lsp-item #6) 5 8 (face completions-common-part)) :ki= nd 3 :detail "unsafe fn(__m128i, __m128i) -> __m128i" :documentation (:kind= "markdown" :value "Blend packed 16-bit integers from `a` and `b` using the= mask `IMM8`.\n\nThe mask bits determine the selection. A clear bit selects= the\ncorresponding element of `a`, and a set bit the corresponding\nelemen= t of `b`.\n\n[Intel's documentation](https://www.intel.com/content/www/us/e= n/docs/intrinsics-guide/index.html#text=3D_mm_blend_epi16)") :deprecated :j= son-false :sortText "fffffff0" :filterText #("_mm_blend_epi16" 5 8 (face co= mpletions-common-part)) :insertTextFormat 2 :textEdit (:range (:start (:lin= e 4 :character 4) :end (:line 4 :character 7)) :newText "_mm_blend_epi16(${= 1:a}, ${2:b})$0") :additionalTextEdits [] :command (:title "triggerParamete= rHints" :command "rust-analyzer.triggerParameterHints") :data (:position (:= textDocument (:uri "file:///home/brennan/test_rust/src/bin/test_rust.rs") := position (:line 4 :character 7)) :imports [(:full_import_path "std::arch::x= 86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi16")]))) 21 24 (face c= ompletions-common-part)))) error("Internal error: %s doesn't match %s" #("_mm_blend_epi16(=E2=80=A6)= (use std::arch::x86_64::_mm_blend_epi16)" 0 1 (eglot--lsp-item (:label #2 = :kind 3 :detail "unsafe fn(__m128i, __m128i) -> __m128i" :documentation (:k= ind "markdown" :value "Blend packed 16-bit integers from `a` and `b` using = the mask `IMM8`.\n\nThe mask bits determine the selection. A clear bit sele= cts the\ncorresponding element of `a`, and a set bit the corresponding\nele= ment of `b`.\n\n[Intel's documentation](https://www.intel.com/content/www/u= s/en/docs/intrinsics-guide/index.html#text=3D_mm_blend_epi16)") :deprecated= :json-false :sortText "fffffff0" :filterText #("_mm_blend_epi16" 5 8 (face= completions-common-part)) :insertTextFormat 2 :textEdit (:range (:start (:= line 4 :character 4) :end (:line 4 :character 7)) :newText "_mm_blend_epi16= (${1:a}, ${2:b})$0") :additionalTextEdits [] :command (:title "triggerParam= eterHints" :command "rust-analyzer.triggerParameterHints") :data (:position= (:textDocument (:uri "file:///home/brennan/test_rust/src/bin/test_rust.rs"= ) :position (:line 4 :character 7)) :imports [(:full_import_path "std::arch= ::x86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi16")]))) 5 8 (face = completions-common-part)) "\\`len") completion-pcm--merge-completions((... ... ... ... ... ... ... ... ... ..= . ... ... ... ... ...) ("len")) completion-pcm--merge-try(("len") (... ... ... ... ... ... ... ... ... ..= . ... ... ... ... ...) "" "") completion-pcm-try-completion("len" #f(compiled-function (pattern pred ac= tion) #) nil 3) #f(compiled-function (style) #)(partial-comp= letion) #f(compiled-function (elt) #)(partial-comple= tion) mapc(#f(compiled-function (elt) #) (eglot--d= umb-flex basic partial-completion emacs22)) seq-do(#f(compiled-function (elt) #) (eglot-= -dumb-flex basic partial-completion emacs22)) seq-some(#f(compiled-function (style) #) (eg= lot--dumb-flex basic partial-completion emacs22)) completion--nth-completion(1 "len" #f(compiled-function (pattern pred act= ion) #) nil 3 (metadata (category . eglot-capf= ) (display-sort-function . #f(compiled-function (completions) #)))) completion-try-completion("len" #f(compiled-function (pattern pred action= ) #) nil 3 (metadata (category . eglot-capf) (= display-sort-function . #f(compiled-function (completions) #)))) ivy-completion-in-region(# 38 #f(compiled-f= unction (pattern pred action) #) nil) completion-in-region(# 38 #f(compiled-funct= ion (pattern pred action) #) nil) completion-at-point() complete-symbol(nil) funcall-interactively(complete-symbol nil) call-interactively(complete-symbol nil nil) command-execute(complete-symbol) From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 24 15:41:34 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 20:41:34 +0000 Received: from localhost ([127.0.0.1]:46711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSk3x-0003FO-D3 for submit@debbugs.gnu.org; Wed, 24 Jan 2024 15:41:34 -0500 Received: from lists.gnu.org ([2001:470:142::17]:35566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSk3v-0003FB-4R for submit@debbugs.gnu.org; Wed, 24 Jan 2024 15:41:32 -0500 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 1rSk3k-0004ye-8Y for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 15:41:20 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSk3h-0007vJ-N2 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 15:41:20 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-50edf4f478eso7879272e87.3 for ; Wed, 24 Jan 2024 12:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706128876; x=1706733676; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TxU53JOvnVFZ7+Ve0bzbh12QwkpUvOJ+n5sY9ZIkZzU=; b=fav+FylhkRbKZJhvM7aGbGQR6vW0lvd0kXLT0Cjfeb216vdr1EoK3BThV41K7iJX8b uWbHGV2mKOPorj3VCHXtXZn03d9Wp18QAysfK78cAvllRW1LC5mW2DpwI5u8Npqo7U9n SPQJes0GOZUVWwIx8fA+vePebZ56SaqLIIgvR8rvu/6TPPr4kQyNChwIutC03ge12n+h anF7HCXUYcn11Oyj18rHF8I8fwTj3nZ060x1svB579eA5aMcNjHPYqnmUZ2ozexkcbvx Rp7LMNpZ45K8MdFBCOcPqbA5+wSdvMC7uRwpKbJ6JHxOHKS8p8/msdYttZdVh820H4to sJpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706128876; x=1706733676; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TxU53JOvnVFZ7+Ve0bzbh12QwkpUvOJ+n5sY9ZIkZzU=; b=xUfw4MqCddWvfBU8BDmKAA1VF4t2+QX/ZXvbJOKYV7SJ1c/Xk+brMO1SyrE+39N8N7 ZzWhBmi6kztGS1uh7+5+LdLc/m2y2kX/DAzmu5ylJ8RaO/oiIKabkjDGAfSwFJwmyr9m Tt9pcw1EMgFUBiSgdnxAZZDkHlDK+kJxY58RFdWml3UXRPhQT0P4/X/EkBfuNhN72/zy 2bhUU0osoIYnXLROml2dyZG1L/wEoyB86kUkey6uGHniiarrLeKsNvDOfxbwyv8LdDBw tnHzy0/jACtnpwM2FnjYjkt2pXRMW9bjawV+lvOjkh+5/EcoWk2Hv/mf7O9LN6SWXle2 n8Lg== X-Gm-Message-State: AOJu0YzmLN1b+3rh8pL/ht8PyAxQJ1A/TXts8xk+OgHlFx19FPUC/o5d ozV0QSM/HQ6hmodiXR9tuX1U3RSP0k15u5y9vhn5+kDvA1NWFATeYEx2L94XKnZIPbmKm5o69/B NAumJtjM0xfTO+SbupvpgLj1LnyU= X-Google-Smtp-Source: AGHT+IHZOhP2/DCkxOqdMlVdJkP1Q0ugE9nQnHJ0AkTBTtGFC44W7BDuSklGIS6rSMHW+lRifVDwqNC48R1KaWKCeJ8= X-Received: by 2002:a05:6512:31c1:b0:50e:4e6c:ea8f with SMTP id j1-20020a05651231c100b0050e4e6cea8fmr4916061lfe.41.1706128875402; Wed, 24 Jan 2024 12:41:15 -0800 (PST) MIME-Version: 1.0 References: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> In-Reply-To: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Wed, 24 Jan 2024 20:41:03 +0000 Message-ID: Subject: Re: Eglot completion has stopped working in some cases To: Brennan Vincent Content-Type: multipart/alternative; boundary="0000000000008f3939060fb7150a" Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: "simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --0000000000008f3939060fb7150a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ok, but please explain exactly what "attempting completion" amounts to. Read the manual about how Eglot bugs should be reported, Emacs -Q etc. Thanks On Wed, Jan 24, 2024, 20:37 Brennan Vincent wrote: > I bisected the issue to e93d99a4a0ce578249304dce350465c580a49892, so > including Jo=C3=A3o. > > In some cases when attempting to complete using eglot, I am getting > errors rather than a list of completions. I haven't been able to debug > why but it seems to be happening in "pcm" completion style. > > For example, in a Rust crate with the following main file: > > fn foo_len() { > } > > fn main() { > len > } > > positioning my cursor after "len" and attempting completion yields the > following error message: > > completion-pcm--merge-completions: Internal error: _mm_blend_epi16(=E2=80= =A6) > (use std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \`len > > Full backtrace: > > Debugger entered--Lisp error: (error #("Internal error: _mm_blend_epi16(= =E2=80=A6) > (use std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \\`len" 16= 17 > (eglot--lsp-item (:label #("_mm_blend_epi16(=E2=80=A6) (use > std::arch::x86_64::_mm_blend_epi16)" 0 1 (eglot--lsp-item #5) 5 8 (face > completions-common-part)) :kind 3 :detail "unsafe fn(__m128i, __m128i) -> > __m128i" :documentation (:kind "markdown" :value "Blend packed 16-bit > integers from `a` and `b` using the mask `IMM8`.\n\nThe mask bits determi= ne > the selection. A clear bit selects the\ncorresponding element of `a`, and= a > set bit the corresponding\nelement of `b`.\n\n[Intel's documentation]( > https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#= text=3D_mm_blend_epi16)") > :deprecated :json-false :sortText "fffffff0" :filterText > #("_mm_blend_epi16" 5 8 (face completions-common-part)) :insertTextFormat= 2 > :textEdit (:range (:start (:line 4 :character 4) :end (:line 4 :character > 7)) :newText "_mm_blend_epi16(${1:a}, ${2:b})$0") :additionalTextEdits [] > :command (:title "triggerParameterHints" :command > "rust-analyzer.triggerParameterHints") :data (:position (:textDocument > (:uri "file:///home/brennan/test_rust/src/bin/test_rust.rs") :position > (:line 4 :character 7)) :imports [(:full_import_path > "std::arch::x86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi16")]))= ) > 21 24 (face completions-common-part))) > signal(error (#("Internal error: _mm_blend_epi16(=E2=80=A6) (use > std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \\`len" 16 17 > (eglot--lsp-item (:label #("_mm_blend_epi16(=E2=80=A6) (use > std::arch::x86_64::_mm_blend_epi16)" 0 1 (eglot--lsp-item #6) 5 8 (face > completions-common-part)) :kind 3 :detail "unsafe fn(__m128i, __m128i) -> > __m128i" :documentation (:kind "markdown" :value "Blend packed 16-bit > integers from `a` and `b` using the mask `IMM8`.\n\nThe mask bits determi= ne > the selection. A clear bit selects the\ncorresponding element of `a`, and= a > set bit the corresponding\nelement of `b`.\n\n[Intel's documentation]( > https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#= text=3D_mm_blend_epi16)") > :deprecated :json-false :sortText "fffffff0" :filterText > #("_mm_blend_epi16" 5 8 (face completions-common-part)) :insertTextFormat= 2 > :textEdit (:range (:start (:line 4 :character 4) :end (:line 4 :character > 7)) :newText "_mm_blend_epi16(${1:a}, ${2:b})$0") :additionalTextEdits [] > :command (:title "triggerParameterHints" :command > "rust-analyzer.triggerParameterHints") :data (:position (:textDocument > (:uri "file:///home/brennan/test_rust/src/bin/test_rust.rs") :position > (:line 4 :character 7)) :imports [(:full_import_path > "std::arch::x86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi16")]))= ) > 21 24 (face completions-common-part)))) > error("Internal error: %s doesn't match %s" #("_mm_blend_epi16(=E2=80= =A6) (use > std::arch::x86_64::_mm_blend_epi16)" 0 1 (eglot--lsp-item (:label #2 :kin= d > 3 :detail "unsafe fn(__m128i, __m128i) -> __m128i" :documentation (:kind > "markdown" :value "Blend packed 16-bit integers from `a` and `b` using th= e > mask `IMM8`.\n\nThe mask bits determine the selection. A clear bit select= s > the\ncorresponding element of `a`, and a set bit the corresponding\neleme= nt > of `b`.\n\n[Intel's documentation]( > https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#= text=3D_mm_blend_epi16)") > :deprecated :json-false :sortText "fffffff0" :filterText > #("_mm_blend_epi16" 5 8 (face completions-common-part)) :insertTextFormat= 2 > :textEdit (:range (:start (:line 4 :character 4) :end (:line 4 :character > 7)) :newText "_mm_blend_epi16(${1:a}, ${2:b})$0") :additionalTextEdits [] > :command (:title "triggerParameterHints" :command > "rust-analyzer.triggerParameterHints") :data (:position (:textDocument > (:uri "file:///home/brennan/test_rust/src/bin/test_rust.rs") :position > (:line 4 :character 7)) :imports [(:full_import_path > "std::arch::x86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi16")]))= ) > 5 8 (face completions-common-part)) "\\`len") > completion-pcm--merge-completions((... ... ... ... ... ... ... ... ... > ... ... ... ... ... ...) ("len")) > completion-pcm--merge-try(("len") (... ... ... ... ... ... ... ... ... > ... ... ... ... ... ...) "" "") > completion-pcm-try-completion("len" #f(compiled-function (pattern pred > action) #) nil 3) > #f(compiled-function (style) # -0x32c2df51d2b464c>)(partial-completion) > #f(compiled-function (elt) # 0x19004498146b82cc>)(partial-completion) > mapc(#f(compiled-function (elt) #) > (eglot--dumb-flex basic partial-completion emacs22)) > seq-do(#f(compiled-function (elt) #) > (eglot--dumb-flex basic partial-completion emacs22)) > seq-some(#f(compiled-function (style) #) > (eglot--dumb-flex basic partial-completion emacs22)) > completion--nth-completion(1 "len" #f(compiled-function (pattern pred > action) #) nil 3 (metadata (category . > eglot-capf) (display-sort-function . #f(compiled-function (completions) > #)))) > completion-try-completion("len" #f(compiled-function (pattern pred > action) #) nil 3 (metadata (category . > eglot-capf) (display-sort-function . #f(compiled-function (completions) > #)))) > ivy-completion-in-region(# 38 > #f(compiled-function (pattern pred action) #= ) > nil) > completion-in-region(# 38 > #f(compiled-function (pattern pred action) #= ) > nil) > completion-at-point() > complete-symbol(nil) > funcall-interactively(complete-symbol nil) > call-interactively(complete-symbol nil nil) > command-execute(complete-symbol) > > --0000000000008f3939060fb7150a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok, but please explain exactly what "attempting comp= letion" amounts to. Read the manual about how Eglot bugs should be rep= orted, Emacs -Q etc. Thanks=C2=A0

On Wed, Jan 24, 2024, 20:37 Brennan Vincen= t <brennan@umanwizard.com&= gt; wrote:
I bisected the issue to = e93d99a4a0ce578249304dce350465c580a49892, so
including Jo=C3=A3o.

In some cases when attempting to complete using eglot, I am getting
errors rather than a list of completions. I haven't been able to debug<= br> why but it seems to be happening in "pcm" completion style.

For example, in a Rust crate with the following main file:

fn foo_len() {
}

fn main() {
=C2=A0 =C2=A0 len
}

positioning my cursor after "len" and attempting completion yield= s the
following error message:

completion-pcm--merge-completions: Internal error: _mm_blend_epi16(=E2=80= =A6)
(use std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \`len

Full backtrace:

Debugger entered--Lisp error: (error #("Internal error: _mm_blend_epi1= 6(=E2=80=A6) (use std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match= \\`len" 16 17 (eglot--lsp-item (:label #("_mm_blend_epi16(=E2=80= =A6) (use std::arch::x86_64::_mm_blend_epi16)" 0 1 (eglot--lsp-item #5= ) 5 8 (face completions-common-part)) :kind 3 :detail "unsafe fn(__m12= 8i, __m128i) -> __m128i" :documentation (:kind "markdown"= :value "Blend packed 16-bit integers from `a` and `b` using the mask = `IMM8`.\n\nThe mask bits determine the selection. A clear bit selects the\n= corresponding element of `a`, and a set bit the corresponding\nelement of `= b`.\n\n[Intel's documentation](https://www.intel.com/content/www/= us/en/docs/intrinsics-guide/index.html#text=3D_mm_blend_epi16)") := deprecated :json-false :sortText "fffffff0" :filterText #("_= mm_blend_epi16" 5 8 (face completions-common-part)) :insertTextFormat = 2 :textEdit (:range (:start (:line 4 :character 4) :end (:line 4 :character= 7)) :newText "_mm_blend_epi16(${1:a}, ${2:b})$0") :additionalTex= tEdits [] :command (:title "triggerParameterHints" :command "= ;rust-analyzer.triggerParameterHints") :data (:position (:textDocument= (:uri "file:///home/brennan/test_rust/src/bin/test_rust.rs&q= uot;) :position (:line 4 :character 7)) :imports [(:full_import_path "= std::arch::x86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi= 16")]))) 21 24 (face completions-common-part)))
=C2=A0 signal(error (#("Internal error: _mm_blend_epi16(=E2=80=A6) (us= e std::arch::x86_64::_mm_blend_epi16) doesn=E2=80=99t match \\`len" 16= 17 (eglot--lsp-item (:label #("_mm_blend_epi16(=E2=80=A6) (use std::a= rch::x86_64::_mm_blend_epi16)" 0 1 (eglot--lsp-item #6) 5 8 (face comp= letions-common-part)) :kind 3 :detail "unsafe fn(__m128i, __m128i) -&g= t; __m128i" :documentation (:kind "markdown" :value "Bl= end packed 16-bit integers from `a` and `b` using the mask `IMM8`.\n\nThe m= ask bits determine the selection. A clear bit selects the\ncorresponding el= ement of `a`, and a set bit the corresponding\nelement of `b`.\n\n[Intel= 9;s documentation](https://www.intel.com/content/www/us/en/docs/intri= nsics-guide/index.html#text=3D_mm_blend_epi16)") :deprecated :json= -false :sortText "fffffff0" :filterText #("_mm_blend_epi16&q= uot; 5 8 (face completions-common-part)) :insertTextFormat 2 :textEdit (:ra= nge (:start (:line 4 :character 4) :end (:line 4 :character 7)) :newText &q= uot;_mm_blend_epi16(${1:a}, ${2:b})$0") :additionalTextEdits [] :comma= nd (:title "triggerParameterHints" :command "rust-analyzer.t= riggerParameterHints") :data (:position (:textDocument (:uri "fil= e:///home/brennan/test_rust/src/bin/test_rust.rs") :position = (:line 4 :character 7)) :imports [(:full_import_path "std::arch::x86_6= 4::_mm_blend_epi16" :imported_name "_mm_blend_epi16")]))) 21= 24 (face completions-common-part))))
=C2=A0 error("Internal error: %s doesn't match %s" #("_m= m_blend_epi16(=E2=80=A6) (use std::arch::x86_64::_mm_blend_epi16)" 0 1= (eglot--lsp-item (:label #2 :kind 3 :detail "unsafe fn(__m128i, __m12= 8i) -> __m128i" :documentation (:kind "markdown" :value &= quot;Blend packed 16-bit integers from `a` and `b` using the mask `IMM8`.\n= \nThe mask bits determine the selection. A clear bit selects the\ncorrespon= ding element of `a`, and a set bit the corresponding\nelement of `b`.\n\n[I= ntel's documentation](https://www.intel.com/content/www/us/en/doc= s/intrinsics-guide/index.html#text=3D_mm_blend_epi16)") :deprecate= d :json-false :sortText "fffffff0" :filterText #("_mm_blend_= epi16" 5 8 (face completions-common-part)) :insertTextFormat 2 :textEd= it (:range (:start (:line 4 :character 4) :end (:line 4 :character 7)) :new= Text "_mm_blend_epi16(${1:a}, ${2:b})$0") :additionalTextEdits []= :command (:title "triggerParameterHints" :command "rust-ana= lyzer.triggerParameterHints") :data (:position (:textDocument (:uri &q= uot;file:///home/brennan/test_rust/src/bin/test_rust.rs") :po= sition (:line 4 :character 7)) :imports [(:full_import_path "std::arch= ::x86_64::_mm_blend_epi16" :imported_name "_mm_blend_epi16")= ]))) 5 8 (face completions-common-part)) "\\`len")
=C2=A0 completion-pcm--merge-completions((... ... ... ... ... ... ... ... .= .. ... ... ... ... ... ...) ("len"))
=C2=A0 completion-pcm--merge-try(("len") (... ... ... ... ... ...= ... ... ... ... ... ... ... ... ...) "" "")
=C2=A0 completion-pcm-try-completion("len" #f(compiled-function (= pattern pred action) #<bytecode 0x19ec37e26e8f5965>) nil 3)
=C2=A0 #f(compiled-function (style) #<bytecode -0x32c2df51d2b464c>)(p= artial-completion)
=C2=A0 #f(compiled-function (elt) #<bytecode 0x19004498146b82cc>)(par= tial-completion)
=C2=A0 mapc(#f(compiled-function (elt) #<bytecode 0x19004498146b82cc>= ) (eglot--dumb-flex basic partial-completion emacs22))
=C2=A0 seq-do(#f(compiled-function (elt) #<bytecode 0x19004498146b82cc&g= t;) (eglot--dumb-flex basic partial-completion emacs22))
=C2=A0 seq-some(#f(compiled-function (style) #<bytecode -0x32c2df51d2b46= 4c>) (eglot--dumb-flex basic partial-completion emacs22))
=C2=A0 completion--nth-completion(1 "len" #f(compiled-function (p= attern pred action) #<bytecode 0x19ec37e26e8f5965>) nil 3 (metadata (= category . eglot-capf) (display-sort-function . #f(compiled-function (compl= etions) #<bytecode -0x67c261ef9006e89>))))
=C2=A0 completion-try-completion("len" #f(compiled-function (patt= ern pred action) #<bytecode 0x19ec37e26e8f5965>) nil 3 (metadata (cat= egory . eglot-capf) (display-sort-function . #f(compiled-function (completi= ons) #<bytecode -0x67c261ef9006e89>))))
=C2=A0 ivy-completion-in-region(#<marker at 35 in test_rust.rs&= gt; 38 #f(compiled-function (pattern pred action) #<bytecode 0x19ec37e26= e8f5965>) nil)
=C2=A0 completion-in-region(#<marker at 35 in test_rust.rs> = 38 #f(compiled-function (pattern pred action) #<bytecode 0x19ec37e26e8f5= 965>) nil)
=C2=A0 completion-at-point()
=C2=A0 complete-symbol(nil)
=C2=A0 funcall-interactively(complete-symbol nil)
=C2=A0 call-interactively(complete-symbol nil nil)
=C2=A0 command-execute(complete-symbol)

--0000000000008f3939060fb7150a-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 24 19:44:05 2024 Received: (at submit) by debbugs.gnu.org; 25 Jan 2024 00:44:05 +0000 Received: from localhost ([127.0.0.1]:46900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSnqc-0001LM-8G for submit@debbugs.gnu.org; Wed, 24 Jan 2024 19:44:05 -0500 Received: from lists.gnu.org ([2001:470:142::17]:47092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSnqa-0001Kk-80 for submit@debbugs.gnu.org; Wed, 24 Jan 2024 19:44:00 -0500 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 1rSnqP-0001UB-C5 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 19:43:49 -0500 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSnqN-0000Lh-O5 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 19:43:49 -0500 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5100fdd37f7so2030787e87.2 for ; Wed, 24 Jan 2024 16:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706143426; x=1706748226; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GGIcalK9H/GkCBdWXMlztSMT913Ro7PQZBnP7ZQ2HE8=; b=BxSj7iY280CntQ9pdxftrKLFnYoGl5MKW/jdXzeugwR1p3vcMYfq6CKDxLRDRN4a+e q1oJ17PIvydRTx6ZFpDeepcg9sHGaUIBHHM96z8COtfOa7xwWizeDEBkOeEzMxcBdW9+ 5QbMvwSL9HDVYKxnNQRUGdWTJT/pr6txAFepwfQgAcvgGAuRvIOVtTZbqOdu6Py8xVWl dT8egYNv+fvf83tX21UtJ/Fg0T0VfX8fn9l82n10Muab8XVyecSJuUESIgMOdcymh54F mXr/LkDj/Q1CgGW9pZeYw6Tycb2/xuzSCqgbu659KyVTQKx2WRl29tS12xfYsyHk5Kpy KUmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706143426; x=1706748226; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GGIcalK9H/GkCBdWXMlztSMT913Ro7PQZBnP7ZQ2HE8=; b=DqDKeJeweyVxWN6wjO/FtSzFW0fd7FoxvjrGcLSzbhHN7LFNdtzFWa0RrMx3iRCErl n3LjHewKPWyTyifzQEe540ADV457GCm+w3lcUXS4/JWWk4XdVXBYYsikfrQERbHIvXHQ 1NIw5bASgx7L9FfV6SMRhvYGPxshqZ7vXvqXY1XlMKcak+L5JV3cL4lyjK+Kdu2RUYUv NiFbkzpuPl7HAw43hnFBkM4lBr084lzcKGcZ0fnkkSSR6XWQbdF+MKqI2/ygTD8dhO9z tjjFyynYeJF4L6248YQtCLiE84J8RZdGSSazx+tkFX75z7COMVpg2HDK6kq8Tvlc/Z2j GSYw== X-Gm-Message-State: AOJu0YyHFTMGwmNkenWH50LWrqxq/5tr4G8Ky2F679z7tfChoZNr7JOL w3fus7k1DxD5xRXFPehCDj33kzxiMfj7HDKV1tpSDXeNz5QJ6otnNrI0wLgTyeQEQZNPmC0bj1h tMEk81BjZTfdyUBIFUcKqOIi7hMNsnX1kVrQ= X-Google-Smtp-Source: AGHT+IHqhV9vndhbkDtqTBOdEQKBgTqUMoLCTyB0Q5Jw0dGTHUK2NN2D1+nqIhODhu0obGRbewHgbaxhWzMW47BEyso= X-Received: by 2002:ac2:599e:0:b0:50e:9368:7e56 with SMTP id w30-20020ac2599e000000b0050e93687e56mr39380lfn.2.1706143425672; Wed, 24 Jan 2024 16:43:45 -0800 (PST) MIME-Version: 1.0 References: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> In-Reply-To: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Thu, 25 Jan 2024 00:43:38 +0000 Message-ID: Subject: Re: Eglot completion has stopped working in some cases To: Brennan Vincent Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, Jan 24, 2024 at 8:37=E2=80=AFPM Brennan Vincent wrote: > For example, in a Rust crate with the following main file: > > fn foo_len() { > } > > fn main() { > len > } I've reproduced this with latest master: ~/Source/Emacs/emacs/src/emacs -Q ~/MoreSource/Rust/hello/src/main.rs -f rust-ts-mode -f eglot where main.rs is the provided snippet. Pressing C-M-i with point after 'len' yields the error. The error only happens in partial-completion is in the completion-styles variable, so a workaround is to remove partial-completion from completion-styles, at least in Eglot enabled buffers. I will look now for the underlying cause. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 24 20:35:35 2024 Received: (at submit) by debbugs.gnu.org; 25 Jan 2024 01:35:35 +0000 Received: from localhost ([127.0.0.1]:46929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSoeV-0005RJ-EX for submit@debbugs.gnu.org; Wed, 24 Jan 2024 20:35:35 -0500 Received: from lists.gnu.org ([2001:470:142::17]:33956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSoeT-0005R6-ET for submit@debbugs.gnu.org; Wed, 24 Jan 2024 20:35:34 -0500 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 1rSoeH-00016m-91 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 20:35:21 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSoeE-0003kJ-W8 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 20:35:20 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5100ed2b33dso2306422e87.0 for ; Wed, 24 Jan 2024 17:35:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706146516; x=1706751316; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=48jT720GU+/8XZEmAROTghency4ZFs7Q9zU+RumsyI8=; b=DtF0pckNAYbLEaEnvw0Kq47vAcggdIOw4NwlSXDLKD1ukFGply8JntRrqY6EGhISid 0qusNM7I7Dq72+tG4b8/Q8fD87haEEEWqoSK/ShLi9lo4UmbTvBeM8Rgx3dXVLzvU4NN EMXro/XchBws89vliVqQxh+tur+xeBfqhsAsRyITZBZyMMW+IdrudiX0YKEaTRfZfV07 /TzzO1yYEQzPy1BOkV9iii7grPtUqCMVYMCuIwJi+jJQJjizQLwctaErh9UNdeoauTGw WQ37JE7HpkVLrS6UElddJG21bBnOYWgPUj6tS4Lan1ditvI6qw3CLmPumWkUdWv/NtM2 6N1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706146516; x=1706751316; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=48jT720GU+/8XZEmAROTghency4ZFs7Q9zU+RumsyI8=; b=OFlNWKd8tVksaajzx9KNwJpE3ZEa2wUyVgGCwxLE2vx9EQ+Mc5H3TiD2jFjb3RjvtW ZWWMpqSDVcKUzrMPxiX73yaIb1SpJyhac6Selwtn/R3Zfmvs/B+7/SRAkceFWWSnMvGF TOVzkB160hdB3qHVC7UnYE/P+KtNPh+EunXKmsFbfQMh5OUNfpQImS9y6BBMoKNuIkYA DzXEj7jmcGDLE312l5ySbmsL1NBTzv935nHf5C86yNGBcyCKaqGtMJCIXlYhJPHybMgC fuYeLoEeghuYq5z6MNo82YnEjJXjaIWT9OP1KWUvbUyIgTsTFef9lnuTrWkiVShnottX ybCA== X-Gm-Message-State: AOJu0YxMZiz2cTBi/juCdYsj2oTnEZYhy9H0YUW2lNHichdRazqfkOaH pPUWgOeqF+C8xmmMB/QUTPJ/l+ijk4okJKIwekmYHK6WHkGD5qi9WlSl2zXBJXCIZUUCHDGzc3E veUQgvrlffT8guRnYPP32gVbF1fQ= X-Google-Smtp-Source: AGHT+IGbCKAfEBsWkb03VJeyFF/D5RR0M1JUzWRY2btcQkJY/j+0IC7FGdU/P8/nrDz7aZ5wHWDawsgY/MU8T9GiyIU= X-Received: by 2002:a05:6512:e96:b0:50e:712b:393f with SMTP id bi22-20020a0565120e9600b0050e712b393fmr74549lfb.80.1706146515470; Wed, 24 Jan 2024 17:35:15 -0800 (PST) MIME-Version: 1.0 References: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Thu, 25 Jan 2024 01:35:08 +0000 Message-ID: Subject: Re: Eglot completion has stopped working in some cases To: Brennan Vincent , Stefan Monnier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Thu, Jan 25, 2024 at 12:43=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > > On Wed, Jan 24, 2024 at 8:37=E2=80=AFPM Brennan Vincent wrote: > > > For example, in a Rust crate with the following main file: > > > > fn foo_len() { > > } > > > > fn main() { > > len > > } > > I've reproduced this with latest master: > > ~/Source/Emacs/emacs/src/emacs -Q ~/MoreSource/Rust/hello/src/main.rs > -f rust-ts-mode -f eglot > > where main.rs is the provided snippet. > > Pressing C-M-i with point after 'len' yields the error. > > The error only happens in partial-completion is in the completion-styles > variable, so a workaround is to remove partial-completion from > completion-styles, at least in Eglot enabled buffers. > > I will look now for the underlying cause. Stefan, this is down to partial-completion somehow thinking that "\\'len" should match at least some LSP-provided completion candidate, otherwise it's an "internal error" I wish I could turn off all the styles from the table but I can only add to them. I simply cannot write a reasonable try-completion thing for LSP completions. LSP completions are really designed to be navigated using a company-like popup. Without it they should almost always use the *Completions* buffer, and rarely ever Emacs partial completion shenanigans. Nevertheless, I need to plug this bug somehow in Eglot. Brennan, can you try this patch I've just pushed? diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 511000927cf..c5fbf5eb9d5 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3060,9 +3060,13 @@ eglot--dumb-flex finally (cl-return comp))) (defun eglot--dumb-allc (pat table pred _point) (funcall table pat pred t)= ) +(defun eglot--dumb-tryc (pat table pred point) + (if-let ((probe (funcall table pat pred nil))) + (cons probe (length probe)) + (cons pat point))) (add-to-list 'completion-category-defaults '(eglot-capf (styles eglot--dumb-flex))) -(add-to-list 'completion-styles-alist '(eglot--dumb-flex ignore eglot--dumb-allc)) +(add-to-list 'completion-styles-alist '(eglot--dumb-flex eglot--dumb-tryc eglot--dumb-allc)) (defun eglot-completion-at-point () "Eglot's `completion-at-point' function." Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 25 10:34:44 2024 Received: (at submit) by debbugs.gnu.org; 25 Jan 2024 15:34:45 +0000 Received: from localhost ([127.0.0.1]:48908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT1ka-0006Gk-Iq for submit@debbugs.gnu.org; Thu, 25 Jan 2024 10:34:44 -0500 Received: from lists.gnu.org ([2001:470:142::17]:50294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT1kY-0006GS-Ks for submit@debbugs.gnu.org; Thu, 25 Jan 2024 10:34:43 -0500 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 1rT1kJ-00011z-Rv for bug-gnu-emacs@gnu.org; Thu, 25 Jan 2024 10:34:28 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT1kI-0004vf-4F for bug-gnu-emacs@gnu.org; Thu, 25 Jan 2024 10:34:27 -0500 Received: from localhost ([173.205.212.102]) by smtp.umanwizard.com ; 25 Jan 2024 15:34:22 +0000 X-Fes-Received-For: bug-gnu-emacs@gnu.org X-Fes-Received-From: From: Brennan Vincent To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: Eglot completion has stopped working in some cases In-Reply-To: References: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> Date: Thu, 25 Jan 2024 10:34:18 -0500 Message-ID: <87cytpig05.fsf@prescott.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com 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_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) The issue is fixed for me on latest master, which includes the patch you mentioned. Jo=C3=A3o T=C3=A1vora writes: > On Thu, Jan 25, 2024 at 12:43=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: >> >> On Wed, Jan 24, 2024 at 8:37=E2=80=AFPM Brennan Vincent wrote: >> >> > For example, in a Rust crate with the following main file: >> > >> > fn foo_len() { >> > } >> > >> > fn main() { >> > len >> > } >> >> I've reproduced this with latest master: >> >> ~/Source/Emacs/emacs/src/emacs -Q ~/MoreSource/Rust/hello/src/main.rs >> -f rust-ts-mode -f eglot >> >> where main.rs is the provided snippet. >> >> Pressing C-M-i with point after 'len' yields the error. >> >> The error only happens in partial-completion is in the completion-styles >> variable, so a workaround is to remove partial-completion from >> completion-styles, at least in Eglot enabled buffers. >> >> I will look now for the underlying cause. > > Stefan, this is down to partial-completion somehow thinking > that "\\'len" should match at least some LSP-provided > completion candidate, otherwise it's an "internal error" > > I wish I could turn off all the styles from the table but I can > only add to them. I simply cannot write a reasonable > try-completion thing for LSP completions. LSP completions > are really designed to be navigated using a company-like > popup. Without it they should almost always use the *Completions* > buffer, and rarely ever Emacs partial completion shenanigans. > > Nevertheless, I need to plug this bug somehow in Eglot. > > Brennan, can you try this patch I've just pushed? > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index 511000927cf..c5fbf5eb9d5 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -3060,9 +3060,13 @@ eglot--dumb-flex > finally (cl-return comp))) > > (defun eglot--dumb-allc (pat table pred _point) (funcall table pat pred = t)) > +(defun eglot--dumb-tryc (pat table pred point) > + (if-let ((probe (funcall table pat pred nil))) > + (cons probe (length probe)) > + (cons pat point))) > > (add-to-list 'completion-category-defaults '(eglot-capf (styles > eglot--dumb-flex))) > -(add-to-list 'completion-styles-alist '(eglot--dumb-flex ignore > eglot--dumb-allc)) > +(add-to-list 'completion-styles-alist '(eglot--dumb-flex > eglot--dumb-tryc eglot--dumb-allc)) > > (defun eglot-completion-at-point () > "Eglot's `completion-at-point' function." > > Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 25 14:11:46 2024 Received: (at 68699-done) by debbugs.gnu.org; 25 Jan 2024 19:11:46 +0000 Received: from localhost ([127.0.0.1]:49277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT58b-0006lJ-UH for submit@debbugs.gnu.org; Thu, 25 Jan 2024 14:11:46 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:51275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT58Z-0006l2-V7 for 68699-done@debbugs.gnu.org; Thu, 25 Jan 2024 14:11:45 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5101f2dfdadso1364834e87.2 for <68699-done@debbugs.gnu.org>; Thu, 25 Jan 2024 11:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706209891; x=1706814691; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vLRT0c3n4w5j+4Kuz6w+at/LePMgIohJMLXEhkvaick=; b=bjuvzVesGe/HxTeZvbVM2vne9krZ3CNKSSW6/1zvPzFmj61HyWzYPzuYszLac4xAMd yr5jTWEVxuUfSxi7ggWEVZx8sCw/vsu1I8qfW9S84xGLXGvApNZddeBy+iBp12t9rj5D TuMXeALm6jJiZsV80u9DjeCqtJ/HOP2v9jlc5NHDmc07ZJqUoM40XvlNmaLkcoJhX08h YU0Rv4hs7LB/U0zXgqX2/wI6eB3EpSDs6xj1KHMxdR2RWgxDGb5OS1gCmyM3VcLz6VgW iE41MHolIxQT16RFHpRyEEQxKEImFyRYTnmRDZHNuP4GrsJC/4Hk+md3WG9bqggAJUI5 vD+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706209891; x=1706814691; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vLRT0c3n4w5j+4Kuz6w+at/LePMgIohJMLXEhkvaick=; b=E00mzuhdDN1knzSGKkE77X5lPBSpB96/4kodyQ8+nQ6j6aT0SAk3Yv3EUDvrRLUo3T sUyFz1IzBv4Ku/Pt6nWFQ54QwdXoaYkqdSIc0dmzliq4KUhe+fb3km0nD4L1JkF2HqSr aDEyxGyH+4QH5NbQmzuGUbDQcHkuvD7ECCF4HMWgM4aJ0kqcdam7FPFoZCHUkLntY2Sj xrA5VRkcYVUTDzhoyX347ZpJxaqCndcWgo8j6o2utKbCZNzK/wlkvkyf3A9o9d7aGWEk YtITpttyVlWEfQVOTehTXUqNkqh+iDNFQtJ931Itm8zVE7Zo/esTUNMiFrBWLmBHuOzQ PKIQ== X-Gm-Message-State: AOJu0YzPcpiVe3YAYmnMVsJPKiLexoDPSsMoL3Cvirj41neHqWXTMxbQ qnQVeI7wzrVDCiIHMVYdYfOBEFt49WJLFXWPE/1U2VB0G5PnNuNdavIaH+zNBS/ROT1DujXb948 P5+locywbAeOm6kaz4kGLjpJf9zk= X-Google-Smtp-Source: AGHT+IGA8wRMJrOWNzd1SoyLLBIGYN45x4axjLeAmYlCLN3UsunPg9rzqxDUZAQS1/CPFJRkTzs6TWiOXEF2xaHF4LE= X-Received: by 2002:ac2:5dc2:0:b0:510:241b:d9f with SMTP id x2-20020ac25dc2000000b00510241b0d9fmr6512lfq.127.1706209891067; Thu, 25 Jan 2024 11:11:31 -0800 (PST) MIME-Version: 1.0 References: <87mssutqm8.fsf@prescott.mail-host-address-is-not-set> <87cytpig05.fsf@prescott.mail-host-address-is-not-set> In-Reply-To: <87cytpig05.fsf@prescott.mail-host-address-is-not-set> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Thu, 25 Jan 2024 19:11:19 +0000 Message-ID: Subject: Re: bug#68699: Eglot completion has stopped working in some cases To: Brennan Vincent Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68699-done Cc: 68699-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Great, thanks for testing. Closing. I've release Eglot 1.17 with this fix and another completion-related fix. Jo=C3=A3o From unknown Fri Jun 20 05:26:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 23 Feb 2024 12:24:17 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator