From unknown Fri Jun 20 07:19:00 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#78392 <78392@debbugs.gnu.org> To: bug#78392 <78392@debbugs.gnu.org> Subject: Status: 31.0.50; eglot breaks on xref-find-definitions Reply-To: bug#78392 <78392@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:19:00 +0000 retitle 78392 31.0.50; eglot breaks on xref-find-definitions reassign 78392 emacs submitter 78392 "admin@sonictk.com" severity 78392 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon May 12 10:47:07 2025 Received: (at submit) by debbugs.gnu.org; 12 May 2025 14:47:07 +0000 Received: from localhost ([127.0.0.1]:53920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEUQr-0004ei-Dw for submit@debbugs.gnu.org; Mon, 12 May 2025 10:47:07 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53286) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEMfQ-0004LK-2E for submit@debbugs.gnu.org; Mon, 12 May 2025 02:29:37 -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 ) id 1uEMfE-0001nG-0D for bug-gnu-emacs@gnu.org; Mon, 12 May 2025 02:29:24 -0400 Received: from iguana.tulip.relay.mailchannels.net ([23.83.218.253]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEMfB-00023N-0F for bug-gnu-emacs@gnu.org; Mon, 12 May 2025 02:29:23 -0400 X-Sender-Id: dreamhost|x-authsender|admin@sonictk.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8DA40781C32 for ; Mon, 12 May 2025 06:29:17 +0000 (UTC) Received: from pdx1-sub0-mail-a309.dreamhost.com (100-112-106-235.trex-nlb.outbound.svc.cluster.local [100.112.106.235]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 1A3C0782C01 for ; Mon, 12 May 2025 06:29:17 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1747031357; a=rsa-sha256; cv=none; b=dKSRsApEWgWJbHZf0uZGnFVlEswodQcsPBwXA1QzvdFGbpMaKPOxYRZsHzaaqIwbU/pbfg r+IWmBv145LTGtwlXjXLiBUojqL1YW3hA+ac2Rfpyy8ysNyOKJsbBSHJC33VIJn8UkwsUS XRjp6ijNZGHD9L+GGiTuUwh5aOi3M3eS8Nl86GODaCG8cL7vboOUaOeyaUt9GUZiK6HCTK QYbB/lLISbYfUxqCm+oLZx9qpKwVIw/fRyFe2PWLUc04A4GL94kOKpbv30vemCPV4Rpr11 3MJuqXsEQcxsNbDrlto4Bxd9wnajy/CyhM4atrpMK9tPQHYKtjSdjFVtaVJhLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1747031357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: dkim-signature; bh=R6n9rQUvrWOyuGMECCQ45o/kCgEIudHEo5FI/QhCLwQ=; b=pFm/kSL+JW8HoWRjZYIhEfAiGZNRqPxCpKVHiRGY9jRopdHzB6yqF9eGSK86YYSGa6OM/m 5QACYS2rVhlsUmOww5RhD+BR9h4JEtKBRTN0vba51O29yxk52LzEGCdll7oqxiJnQoqmqv Z2G0pYOExcK26/30T9+I7za1h7SNSGqtJrAHQnknWItOp6O6n6NO4xZ7PLrEPhYArpzJO7 w2RRPa0gtasDgkhp11RPBezU8rtw40S80mzqu7VzLA+SMLaX4mdohKg298RtEHbTEBt/lu 2XvEf76u1W2bIj9Cf6RbcHnJypje1tqzoTO5x2DC+EIbpnMi28OL43+S1yq3Mw== ARC-Authentication-Results: i=1; rspamd-5dcf5fb4c6-xnhz4; auth=pass smtp.auth=dreamhost smtp.mailfrom=admin@sonictk.com X-Sender-Id: dreamhost|x-authsender|admin@sonictk.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|admin@sonictk.com X-MailChannels-Auth-Id: dreamhost X-Decisive-Invention: 676784ab6822692f_1747031357353_1777861298 X-MC-Loop-Signature: 1747031357353:2205556858 X-MC-Ingress-Time: 1747031357353 Received: from pdx1-sub0-mail-a309.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.112.106.235 (trex/7.0.3); Mon, 12 May 2025 06:29:17 +0000 Received: from MN2PR20MB3133.namprd20.prod.outlook.com (unknown [52.96.64.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: admin@sonictk.com) by pdx1-sub0-mail-a309.dreamhost.com (Postfix) with ESMTPSA id 4ZwqSr5PjFz52 for ; Sun, 11 May 2025 23:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sonictk.com; s=dreamhost; t=1747031356; bh=R6n9rQUvrWOyuGMECCQ45o/kCgEIudHEo5FI/QhCLwQ=; h=From:To:Subject:Date:Content-Type; b=hbfRaT0wJ5aP5zDgXGL7+JWhdG+kzwhRqYonqMh8BV6CIbJ2dbvz3lhLIJvaWzHKo 8HwOq5FSTQcJR7NluAQ/nvW0pQ2tKuLvaYr5RGrrVVCMpuKlzOzh22DE8Mm0lefG2q yAh2Z/9QDlFeyXvzFUTOoYU0Po6dBPMdBN009Kq/4WlK/5GGQytqJk/cIB9k+/CGCI Scw1mFPtOwcPadiC75CkjRX/Z9O6tqt9jIJSK7R/WE+4Xl6mKPV+LdvgNqb29LcaJx jodNbyrlquzNxm6DMT+yVDv6RLQ7piLzTwimwLMuGe9nk2ReJAU5ExiOijeDK/kUnE 4Ksbe+l1ZP+lg== From: "admin@sonictk.com" To: "bug-gnu-emacs@gnu.org" Subject: 31.0.50; eglot breaks on xref-find-definitions Thread-Topic: 31.0.50; eglot breaks on xref-find-definitions Thread-Index: AQHbwwccNL5aBxVh/02jhNLyG3tFuA== X-MS-Exchange-MessageSentRepresentingType: 1 Date: Mon, 12 May 2025 06:29:15 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-Exchange-Organization-SCL: -1 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 msip_labels: Content-Type: multipart/alternative; boundary="_000_MN2PR20MB31334326FFAF1AE360A84B7CAB97AMN2PR20MB3133namp_" MIME-Version: 1.0 Received-SPF: pass client-ip=23.83.218.253; envelope-from=admin@sonictk.com; helo=iguana.tulip.relay.mailchannels.net 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 12 May 2025 10:47:03 -0400 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 (/) --_000_MN2PR20MB31334326FFAF1AE360A84B7CAB97AMN2PR20MB3133namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Currently, when building from latest Emacs ToT, activating `eglot-mode` in any C++ file using `clangd` and attempting to call `xref-find-definitions` on any definition results in the following error being triggered: ``` Opening input file: Is a directory, c:/Users/sonictk/tmp ``` Where the `.cpp` file is in the given directory. Tried building Emacs using a build from a month-ish ago to find where the regression first occurred and it still had the issue present, even when doing `make distclean` and then `make bootstrap` after re-running `./configure`. `toggle-debug-on-error` gives me: ``` Debugger entered--Lisp error: (file-error "Opening input file" "Is a direct= ory" "c:/Users/sonictk/tmp") eglot--xref-make-match(#("Baz" 0 3 (face font-lock-function-name-face fon= tified t)) "file:///c:/Users/sonictk/tmp/test2.cpp" (:end (:character 11 :l= ine 23) :start (:character 8 :line 23))) #f(compiled-function (loc-or-loc-link) #)((:r= ange (:end (:character 11 :line 23) :start (:character 8 :line 23)) :uri "f= ile:///c:/Users/sonictk/tmp/test2.cpp")) eglot--lsp-xrefs-for-method(:textDocument/definition) #f(compiled-function (backend id) #)(eglot = "LSP identifier at point") apply(#f(compiled-function (backend id) #) = eglot "LSP identifier at point") xref-backend-definitions(eglot "LSP identifier at point") #f(compiled-function () #)() xref-show-definitions-buffer(#f(compiled-function () #) ((window . #) (display-action) (auto-jump= ))) xref--show-defs(#f(compiled-function () #) ni= l) xref--find-definitions("LSP identifier at point" nil) xref-find-definitions("LSP identifier at point") funcall-interactively(xref-find-definitions "LSP identifier at point") command-execute(xref-find-definitions) ``` In GNU Emacs 31.0.50 (build 1, x86_64-w64-mingw32) of 2025-05-11 built on CDW-AQRHE1HHT39 Repository revision: 64eb60bd91dbeed458d5a410e6dc9ab4e9e0a10e Repository branch: HEAD Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.5737) Configured using: 'configure --without-pop --with-imagemagick --without-compress-install -without-dbus --with-gnutls --with-json --with-tree-sitter --without-gconf --with-rsvg --without-gsettings --with-mailutils --with-native-compilation --with-modules --with-xml2 --with-wide-int 'CFLAGS=3D-O3 -ggdb -fno-math-errno -funsafe-math-optimizations -fno-finite-math-only -fno-trapping-math -freciprocal-math -fno-rounding-math -fno-signaling-nans -fassociative-math -fno-signed-zeros -frename-registers -funroll-loops -mtune=3Dnative -march=3Dnative -fomit-frame-pointer -fallow-store-data-races -fno-semantic-interposition -floop-parallelize-all -ftree-parallelize-loops=3D4' PKG_CONFIG_PATH=3D/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig' Configured features: ACL GIF GMP GNUTLS HARFBUZZ IMAGEMAGICK JPEG LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LANG: ENU locale-coding-system: cp1252 Major mode: C++//l Minor modes in effect: eglot-inlay-hints-mode: t eglot--managed-mode: t flymake-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 minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug lisp-mnt 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 tree-widget wid-edit external-completion jsonrpc xref flymake thingatpt project diff diff-mode track-changes easy-mmode ert pp ewoc debug backtrace help-mode find-func filenotify warnings compile text-property-search comint ansi-osc ansi-color ring pcase url-util url-parse auth-source cl-seq eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt gv url-vars imenu comp-run bytecomp byte-compile comp-common rx cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel touch-screen dos-w32 ls-lisp term/w32-nt disp-table term/w32-win w32-win w32-vars term/common-win 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 w32notify w32 lcms2 multi-tty move-toolbar make-network-process tty-child-frames native-compile emacs) Memory information: ((conses 16 576487 112162) (symbols 48 13713 0) (strings 32 43491 4466) (string-bytes 1 1432645) (vectors 16 51034) (vector-slots 8 835660 10348) (floats 8 61 76) (intervals 56 678 13) (buffers 1064 17)) --_000_MN2PR20MB31334326FFAF1AE360A84B7CAB97AMN2PR20MB3133namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Currently, when building from latest Emacs ToT, activating `eglot-mode`
in any C++ file using `clangd` and attempting to call
`xref-find-definitions` on any definition results in the following error
being triggered:

```
Opening input file: Is a directory, c:/Users/sonictk/tmp
```

Where the `.cpp` file is in the given directory. Tried building Emacs
using a build from a month-ish ago to find where the regression first
occurred and it still had the issue present, even when doing `make
distclean` and then `make bootstrap` after re-running `./configure`.

`toggle-debug-on-error` gives me:

```
Debugger entered--Lisp error: (file-error "Opening input file" &q= uot;Is a directory" "c:/Users/sonictk/tmp")
  eglot--xref-make-match(#("Baz" 0 3 (face font-lock-functio= n-name-face fontified t)) "file:///c:/Users/sonictk/tmp/test2.cpp"= ; (:end (:character 11 :line 23) :start (:character 8 :line 23)))
  #f(compiled-function (loc-or-loc-link) #<bytecode 0x413eb090fd3d6= 61>)((:range (:end (:character 11 :line 23) :start (:character 8 :line 2= 3)) :uri "file:///c:/Users/sonictk/tmp/test2.cpp"))
  eglot--lsp-xrefs-for-method(:textDocument/definition)
  #f(compiled-function (backend id) #<bytecode -0x10624bec505aa107&= gt;)(eglot "LSP identifier at point")
  apply(#f(compiled-function (backend id) #<bytecode -0x10624bec505= aa107>) eglot "LSP identifier at point")
  xref-backend-definitions(eglot "LSP identifier at point")<= /div>
  #f(compiled-function () #<bytecode 0x558a9dc3551d156>)()
  xref-show-definitions-buffer(#f(compiled-function () #<bytecode 0= x558a9dc3551d156>) ((window . #<window 9 on test2.cpp>) (display-a= ction) (auto-jump)))
  xref--show-defs(#f(compiled-function () #<bytecode 0x558a9dc3551d= 156>) nil)
  xref--find-definitions("LSP identifier at point" nil)
  xref-find-definitions("LSP identifier at point")
  funcall-interactively(xref-find-definitions "LSP identifier at = point")
  command-execute(xref-find-definitions)
```


In GNU Emacs 31.0.50 (build 1, x86_64-w64-mingw32) of 2025-05-11 built
 on CDW-AQRHE1HHT39
Repository revision: 64eb60bd91dbeed458d5a410e6dc9ab4e9e0a10e
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.5737)=

Configured using:
 'configure --without-pop --with-imagemagick --without-compress-instal= l
 -without-dbus --with-gnutls --with-json --with-tree-sitter
 --without-gconf --with-rsvg --without-gsettings --with-mailutils
 --with-native-compilation --with-modules --with-xml2 --with-wide-int<= /div>
 'CFLAGS=3D-O3 -ggdb -fno-math-errno -funsafe-math-optimizations
 -fno-finite-math-only -fno-trapping-math -freciprocal-math
 -fno-rounding-math -fno-signaling-nans -fassociative-math
 -fno-signed-zeros -frename-registers -funroll-loops -mtune=3Dnative
 -march=3Dnative -fomit-frame-pointer -fallow-store-data-races
 -fno-semantic-interposition -floop-parallelize-all
 -ftree-parallelize-loops=3D4'
 PKG_CONFIG_PATH=3D/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ IMAGEMAGICK JPEG LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: C++//l

Minor modes in effect:
  eglot-inlay-hints-mode: t
  eglot--managed-mode: t
  flymake-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
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt 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 tree-widget
wid-edit external-completion jsonrpc xref flymake thingatpt project diff
diff-mode track-changes easy-mmode ert pp ewoc debug backtrace help-mode
find-func filenotify warnings compile text-property-search comint
ansi-osc ansi-color ring pcase url-util url-parse auth-source cl-seq
eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt
gv url-vars imenu comp-run bytecomp byte-compile comp-common rx cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
touch-screen dos-w32 ls-lisp term/w32-nt disp-table term/w32-win w32-win
w32-vars term/common-win 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 w32notify w32 lcms2 multi-tty move-toolbar make-network-process
tty-child-frames native-compile emacs)

Memory information:
((conses 16 576487 112162) (symbols 48 13713 0)
 (strings 32 43491 4466) (string-bytes 1 1432645) (vectors 16 51034)
 (vector-slots 8 835660 10348) (floats 8 61 76) (intervals 56 678 13)<= /div>
 (buffers 1064 17))
--_000_MN2PR20MB31334326FFAF1AE360A84B7CAB97AMN2PR20MB3133namp_-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 12 11:17:21 2025 Received: (at 78392) by debbugs.gnu.org; 12 May 2025 15:17:22 +0000 Received: from localhost ([127.0.0.1]:54082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEUu9-0000yt-DY for submit@debbugs.gnu.org; Mon, 12 May 2025 11:17:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55148) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEUu6-0000ya-8Y for 78392@debbugs.gnu.org; Mon, 12 May 2025 11:17:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEUtq-0004db-Ei; Mon, 12 May 2025 11:17:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=oUnV0Bakh3oZdnKL8n14YfZzIWp1v5AhSlXiEqA6M2s=; b=S88XthZounpLRnEQXlWZ O/EBLiwpcjHlpVb++/XV3D6dk7Y0EeG4nvXD1avU6J/0t+j/JBEh/phM2+6tanpaLGFDAnw4BhpS1 esMRaw3o5xGR/xBRQI8RvlK6rsUvjac+FvAjMRbkBCJJjdc97hDbv0MKoNDFL/XQgkEAXzZ8GlcSb 113SzZGXb6Ot/ZAHkX+AxVUapcS5T08bSkBeTD74qy3sdoeskCxdl3i4h9EVmnTyKFuj44yslhk5s q8KdkiXQILhAiuTppt+hwnRqEIpWgV3DwtXAWMBwt4TOBJcaf7W5zyAaIg2BGw0duwDtV1EvNz/Ye bTqgoJzXgPZa1A==; Date: Mon, 12 May 2025 18:16:44 +0300 Message-Id: <86bjrx7tb7.fsf@gnu.org> From: Eli Zaretskii To: "admin@sonictk.com" , =?iso-8859-1?Q?Jo=E3o_T=E1vora?= In-Reply-To: (admin@sonictk.com) Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitions References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78392 Cc: 78392@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: -3.3 (---) > From: "admin@sonictk.com" > Date: Mon, 12 May 2025 06:29:15 +0000 > > Currently, when building from latest Emacs ToT, activating `eglot-mode` > in any C++ file using `clangd` and attempting to call > `xref-find-definitions` on any definition results in the following error > being triggered: > > ``` > Opening input file: Is a directory, c:/Users/sonictk/tmp > ``` > > Where the `.cpp` file is in the given directory. Tried building Emacs > using a build from a month-ish ago to find where the regression first > occurred and it still had the issue present, even when doing `make > distclean` and then `make bootstrap` after re-running `./configure`. > > `toggle-debug-on-error` gives me: > > ``` > Debugger entered--Lisp error: (file-error "Opening input file" "Is a directory" "c:/Users/sonictk/tmp") > eglot--xref-make-match(#("Baz" 0 3 (face font-lock-function-name-face fontified t)) > "file:///c:/Users/sonictk/tmp/test2.cpp" (:end (:character 11 :line 23) :start (:character 8 :line 23))) > #f(compiled-function (loc-or-loc-link) #)((:range (:end (:character 11 :line > 23) :start (:character 8 :line 23)) :uri "file:///c:/Users/sonictk/tmp/test2.cpp")) > eglot--lsp-xrefs-for-method(:textDocument/definition) > #f(compiled-function (backend id) #)(eglot "LSP identifier at point") > apply(#f(compiled-function (backend id) #) eglot "LSP identifier at > point") > xref-backend-definitions(eglot "LSP identifier at point") > #f(compiled-function () #)() > xref-show-definitions-buffer(#f(compiled-function () #) ((window . > #) (display-action) (auto-jump))) > xref--show-defs(#f(compiled-function () #) nil) > xref--find-definitions("LSP identifier at point" nil) > xref-find-definitions("LSP identifier at point") > funcall-interactively(xref-find-definitions "LSP identifier at point") > command-execute(xref-find-definitions) > ``` Thanks. Does the patch below give good results? Joćo, I think the assumption that 'retval' there necessarily starts with a slash is because url-generic-parse-url would not necessarily DTRT with Windows file:// URIs; it was fixed lately. So now we need to test for that before applying the fixup. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index eae8e1b..6f6b05a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1165,7 +1165,8 @@ eglot-uri-to-path ;; Remove the leading "/" for local MS Windows-style paths. (normalized (if (and (not remote-prefix) (eq system-type 'windows-nt) - (cl-plusp (length retval))) + (cl-plusp (length retval)) + (eq (aref retval 0) ?/)) (w32-long-file-name (substring retval 1)) retval))) (concat remote-prefix normalized)) From debbugs-submit-bounces@debbugs.gnu.org Mon May 12 13:56:49 2025 Received: (at 78392) by debbugs.gnu.org; 12 May 2025 17:56:49 +0000 Received: from localhost ([127.0.0.1]:54632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEXOR-0000Ta-M5 for submit@debbugs.gnu.org; Mon, 12 May 2025 13:56:49 -0400 Received: from coral.cedar.relay.mailchannels.net ([23.83.210.39]:30163) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEUVs-0004yT-Me for 78392@debbugs.gnu.org; Mon, 12 May 2025 10:52:18 -0400 X-Sender-Id: dreamhost|x-authsender|admin@sonictk.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 24A0132563F for <78392@debbugs.gnu.org>; Mon, 12 May 2025 14:52:15 +0000 (UTC) Received: from pdx1-sub0-mail-a244.dreamhost.com (trex-green-3.trex.outbound.svc.cluster.local [100.112.107.13]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 94832325760 for <78392@debbugs.gnu.org>; Mon, 12 May 2025 14:52:14 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1747061534; a=rsa-sha256; cv=none; b=YfR9OGEz5MhhPNDz5D+VL9BjR/PxFPQio3w/k+SIEzQBuQSi0qDl0la9J9LOqGilU0p6dm V9GzrTxagS8wGnAiVAQS0EfWgW28zeTiqKuT6ZHMCM1nvebxqEKJOiPZPzV8cYFi/wEHUR 8JZMKjsZgHL31A48l0vii8/G/eFcfSN44ZVCYv3QNcYhH2exANsjW3llU1WDy/rmP7zJ2K S3m+Gc2Ze68FlivGZ9lgMsHLd59kxYnnUDZIPOzrt1OUHfI1kN9KIKPSd3nDYuduiBebCC 8sbdofVIgZWZxB42ZXhk0I8s82RAul+qnBuxtw0GpxIAbeF8Jeq3RuGqpH+l6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1747061534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: dkim-signature; bh=ddIZBIaPlepfB6eae/6x9Xvyk6vy7NUrmxbFudGXVVE=; b=fonKtTFXk4jD0i0IguUzRs1pVnuiAmGjrCadYCRB3uIQwFRwt7NTvu0r+r4YL4CcdWFRQ8 AqdEtvlP2/mhMsXNsJ70uHFZr4tjw2oI2ApqjXPBtMzLghgIkYNeixY29YGbpvBFhj1DyG lgZ4P3NuLfXD2lFZybyfutA9FXI23GzVaKJAiL9zns/CSfQjfKtGuozoLjsJoMIeV5IKNC Y91Dn0hUqs+CwpJptW7itP2XqyG8J1vfbTlV5cAQe5s6rwEaNtSbsGAGZZrsxGzUS59EBO FN7Zxq//j6ceYlpBFx3l1XjGQxTH1O3rm+lmc8RrLdK+/BvIzuQRkqyu/hwvWQ== ARC-Authentication-Results: i=1; rspamd-5dcf5fb4c6-2w546; auth=pass smtp.auth=dreamhost smtp.mailfrom=admin@sonictk.com X-Sender-Id: dreamhost|x-authsender|admin@sonictk.com X-MC-Relay: Bad X-MailChannels-SenderId: dreamhost|x-authsender|admin@sonictk.com X-MailChannels-Auth-Id: dreamhost X-Left-Cooing: 669ea9287f672082_1747061534816_2958122798 X-MC-Loop-Signature: 1747061534816:3212411452 X-MC-Ingress-Time: 1747061534816 Received: from pdx1-sub0-mail-a244.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.112.107.13 (trex/7.0.3); Mon, 12 May 2025 14:52:14 +0000 Received: from MN2PR20MB3133.namprd20.prod.outlook.com (unknown [52.96.64.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: admin@sonictk.com) by pdx1-sub0-mail-a244.dreamhost.com (Postfix) with ESMTPSA id 4Zx2dB27J3zFg for <78392@debbugs.gnu.org>; Mon, 12 May 2025 07:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sonictk.com; s=dreamhost; t=1747061534; bh=ddIZBIaPlepfB6eae/6x9Xvyk6vy7NUrmxbFudGXVVE=; h=From:To:Subject:Date:Content-Type; b=qqQHL1WTtxAC6Yjq5LY8YYRfCJUFAlk+VmELSxwEta9+gFwBeQEjMEHViZj/LZO6P aELSGLFaOpbGhiYCgH9RCBV/ewYdln7TR7U5WUIEbqEJ9EbYudnoC6bOkCwm+9O/jh xiOqW9bvyLMTJtnEksXe77IZuuberH16Piokn8K+6XhyjhHO//BlvMLipduepZBaho ZWeIRyA0WcNZXH9EBrUFrVDKH3NaRnTmj1LmIU0PqZamBYIhkzaiFwSLjJd21cLksW kAWE4D+96ZXqJggO7J9vfKU9P9nTR77Lv97cgiJ7CeK5NuZR2fkuqBLatHYYdCzS4V KazUdZxCQgFVA== From: "admin@sonictk.com" To: "78392@debbugs.gnu.org" <78392@debbugs.gnu.org> Subject: 31.0.50; eglot breaks on xref-find-definitions Thread-Topic: 31.0.50; eglot breaks on xref-find-definitions Thread-Index: AQHbw001Xjd5x12F40ahGizuokmCTQ== X-MS-Exchange-MessageSentRepresentingType: 1 Date: Mon, 12 May 2025 14:52:13 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-Exchange-Organization-SCL: -1 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 msip_labels: Content-Type: multipart/alternative; boundary="_000_MN2PR20MB313387E2326EB164B619E557AB97AMN2PR20MB3133namp_" MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78392 X-Mailman-Approved-At: Mon, 12 May 2025 13:56:45 -0400 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 (-) --_000_MN2PR20MB313387E2326EB164B619E557AB97AMN2PR20MB3133namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable As an addendum, I tried downloading the latest provided Emacs Windows build= from https://gnu.mirror.constant.com/emacs/windows/ , which reads as: ``` In GNU Emacs 30.1 (build 2, x86_64-w64-mingw32) of 2025-02-23 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.5737) Configured using: 'configure --with-modules --without-dbus --with-native-compilation=3Daot --without-compress-install --with-tree-sitter CFLAGS=3D-O2 prefix=3D/g/rel/install/emacs-30.1' ``` And with no other configuration changes and with the same clangd, things wo= rk fine (opened the same test2.cpp and attempted to navigate to definition.= ) So this is most likely a regression, but I haven't been able to pin it do= wn to a specific commit yet. --_000_MN2PR20MB313387E2326EB164B619E557AB97AMN2PR20MB3133namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
As an addendum, I tried downloading the latest provided Emacs Windows build= from https://gnu.mirror.constant.com/emacs/windows/ , which reads as:
```
In GNU Emacs 30.1 (build 2, x86_64-w64-mingw32) of 2025-02-23 built on
 AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.5737)=

Configured using:
 'configure --with-modules --without-dbus
 --with-native-compilation=3Daot --without-compress-install
 --with-tree-sitter CFLAGS=3D-O2 prefix=3D/g/rel/install/emacs-30.1'

```

And with no other configuration changes and with the same clangd, things work fine (opened the same test2.cpp and attempted to navigate to definition.) So th= is is most likely a regression, but I haven't been able to pin it down to a= specific commit yet.
--_000_MN2PR20MB313387E2326EB164B619E557AB97AMN2PR20MB3133namp_-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 12 15:19:56 2025 Received: (at 78392) by debbugs.gnu.org; 12 May 2025 19:19:56 +0000 Received: from localhost ([127.0.0.1]:54879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEYgu-0004VV-0l for submit@debbugs.gnu.org; Mon, 12 May 2025 15:19:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38458) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEYgq-0004V9-V6 for 78392@debbugs.gnu.org; Mon, 12 May 2025 15:19:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEYgl-0000az-BB; Mon, 12 May 2025 15:19:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=HmfdoQ7BldNPV/D8imFNVOjhD1SaQZZuypq7gQ5MQ0c=; b=o91VGGnjW+vWFV/1FDoZ GodH9BphT7NeO//SI4hLpAoQaYhC0NkovNJGsrA3JlOZ47JIIDhsTj4f6zlqmq+OBWxqR7lagrO1t UDJvoUyI06UUAYL9Q2XbBTA9oTb9rCPu+1vSxHMOJhI8eT3DiGKsWpHaD9gDqcZm9rzgSjpBDjzaG NgawJao0fGrPP8CsD922YfoEyyS9Lf1ibg9PdM/N3LuL+2wByW3mk3Mbvnt7GF2DGyCSs3oHEB4D1 y6dBEPK4S2FFz4WB8EujWmY+y20lV7ulEry1tGWnTFlqU0pTZszgNL/pwQ9LdCsoy7IdFixO5+nwK 1lWZu6dwAJ5auQ==; Date: Mon, 12 May 2025 22:19:44 +0300 Message-Id: <8634d97i27.fsf@gnu.org> From: Eli Zaretskii To: "admin@sonictk.com" , =?iso-8859-1?Q?Jo=E3o_T=E1vora?= In-Reply-To: (admin@sonictk.com) Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitions References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78392 Cc: 78392@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: -3.3 (---) > From: "admin@sonictk.com" > Date: Mon, 12 May 2025 14:52:13 +0000 > > As an addendum, I tried downloading the latest provided Emacs Windows build from > https://gnu.mirror.constant.com/emacs/windows/ , which reads as: > > ``` > In GNU Emacs 30.1 (build 2, x86_64-w64-mingw32) of 2025-02-23 built on > AVALON > Windowing system distributor 'Microsoft Corp.', version 10.0.19045 > System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.5737) > > Configured using: > 'configure --with-modules --without-dbus > --with-native-compilation=aot --without-compress-install > --with-tree-sitter CFLAGS=-O2 prefix=/g/rel/install/emacs-30.1' > > ``` > > And with no other configuration changes and with the same clangd, things work fine (opened the same > test2.cpp and attempted to navigate to definition.) So this is most likely a regression, but I haven't been > able to pin it down to a specific commit yet. I believe it was the change in url-generic-parse-url, which now produces correct Windows file names, without the extra leading slash. IOW, when we fixed url-generic-parse-url, that fix exposed a subtle bug in Eglot, because Eglot was trying to fix the bug in url-generic-parse-url locally... However, since Eglot is on ELPA and supports earlier Emacs versions, that code should be left in Eglot, just under an additional condition that the file name indeed starts with a slash. Did you have an opportunity to test the patch I suggested with Emacs 31? From debbugs-submit-bounces@debbugs.gnu.org Mon May 12 16:10:41 2025 Received: (at 78392) by debbugs.gnu.org; 12 May 2025 20:10:41 +0000 Received: from localhost ([127.0.0.1]:55090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEZU0-00078w-Bi for submit@debbugs.gnu.org; Mon, 12 May 2025 16:10:41 -0400 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]:45223) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uEZTw-00078P-Ni for 78392@debbugs.gnu.org; Mon, 12 May 2025 16:10:37 -0400 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-2cc57330163so3745146fac.2 for <78392@debbugs.gnu.org>; Mon, 12 May 2025 13:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747080630; x=1747685430; darn=debbugs.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=XLPPF8apCEseBZrcskXeAUHa8Oy3m1QIg/dg3h8wOM0=; b=KE3hsfpeF0WKh7pLX5OwZT3LwfoukPeL0hiAxaBz0hk0WoJTEHVBUnFG3hHwnfvCpd TJ+SJL7Yg3tsPk0v1gVFs4dVaU56PfIaSnI6GnSYtwRTUj/DkMGBxR8ZFbsZR4jjGUpq Nf5RTlxqamwg4EDb1gRJX+/cnd2mgeyjs33APorex9jpeJKyrGD2CSCOZb1IKaIoe4Ay jEVr/KTqNu6Q9QKydmmRkaxHJMDvmlUePuLjHiW0pfNbo5W6fFyK045UZ6ZHE8Ltr+ae hK84xRAEeK9VSSKA8wZHC5J2egTu7bQLS12GbMbnxAxU2u/qG3RbvO8Q31S17Tb/D/lO qQdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747080630; x=1747685430; 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=XLPPF8apCEseBZrcskXeAUHa8Oy3m1QIg/dg3h8wOM0=; b=NfdNn+EGrCjXcqGJVoMgPwtqLbFyvQNv5HKf0NbKu9GnwZ+ucUc1wmhacflSR0BVC/ 96+Gc3U0Zzxa7X8Pohe5y+4vfFL2ehwmTilR3ITHLGEpabZp01XzUIx/Q/ZLl60rZpU2 wpr3/Lla+ndHW+xiyUPc/VmBdonNCp+bDl11wcifYmB9MXdWLleQalB9Mk/09nsnHU+b mZ93vPBl7ww4dDWn5xPj6WtMOC3C+tBHHlawIcBhRBl09iHpgnwnf184WjGg7A0ccrpp V5lLpJXw+p/bwL4trI0P6FlPcD57GCUcWdSrJsAOKzfHnRlZKr4l+wlDNxs+uXmKPjTY hhDQ== X-Forwarded-Encrypted: i=1; AJvYcCX9FECXxOXBLf4qjPPuGEE22sWRmaahOPu18xRQAu3WqR68Ruzt2jx6W60uNLLQ3u93ef2nxQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxQtTpdnfYRVe/yRTvG8hZ83n7eYayogM8pgmpk1LINl1ytWvgP zxn5eSrYHkOw9KuctTq+7dncL0GYMNHS/yUsS+Lv38v7+vjg+z8qMevT/TW5q7HnWLkc9CpkIDP ztEd8U1ircfWdhf1fD1ywmMgvnLT/bQ== X-Gm-Gg: ASbGncugMHKZOOfaH7OfdD8aOqF6+EyF4F7Jw0rUhKHQxyG+r5NfLzRzeI8jU+MFHQs rIYgNGyj62I/KAqgIKny1v66Wx3YqWPCnVLJ63EIJHdZwCYwIkfrkFj2So1ZBXFQbGGqVw5/dyN t06T6TsYz23RBu/WAG11yznpZI8B9Hyxg= X-Google-Smtp-Source: AGHT+IGUEBMfhQVW9Gn3LzygMBJaZPkEIdenGpVtqCVhv55c1YdZmL/7WSqFgzurbd5PgBbJFdXFY5XfZ/vPNm/XK4M= X-Received: by 2002:a05:6870:c114:b0:2d5:2955:aa6b with SMTP id 586e51a60fabf-2dba420d42fmr8932478fac.5.1747080630403; Mon, 12 May 2025 13:10:30 -0700 (PDT) MIME-Version: 1.0 References: <86bjrx7tb7.fsf@gnu.org> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Mon, 12 May 2025 21:10:21 +0100 X-Gm-Features: AX0GCFu2k7NzUj7suXYYwYeV-1KYCT_WKtyAARQz_qS6AFZsvrDuY5AKP8nuZ5U Message-ID: Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitions To: admin@sonictk.com Content-Type: multipart/alternative; boundary="0000000000005e85b70634f5e87e" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78392 Cc: Eli Zaretskii , 78392@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 (-) --0000000000005e85b70634f5e87e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks. I think the patch makes sense. Free to push. If you can, please prefix the first line of commit message with "Eglot: ", like the other ones to this file. Jo=C3=A3o On Mon, May 12, 2025, 20:57 admin@sonictk.com wrote: > Hi Eli: > > Thanks for responding. Confirmed that applying the patch locally solves > the issue. Appreciate the help here! > > > ------------------------------ > *From:* Eli Zaretskii > *Sent:* Monday, May 12, 2025 8:16 AM > *To:* admin@sonictk.com ; Jo=C3=A3o T=C3=A1vora < > joaotavora@gmail.com> > *Cc:* 78392@debbugs.gnu.org <78392@debbugs.gnu.org> > *Subject:* Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitions > > > From: "admin@sonictk.com" > > Date: Mon, 12 May 2025 06:29:15 +0000 > > > > Currently, when building from latest Emacs ToT, activating `eglot-mode` > > in any C++ file using `clangd` and attempting to call > > `xref-find-definitions` on any definition results in the following erro= r > > being triggered: > > > > ``` > > Opening input file: Is a directory, c:/Users/sonictk/tmp > > ``` > > > > Where the `.cpp` file is in the given directory. Tried building Emacs > > using a build from a month-ish ago to find where the regression first > > occurred and it still had the issue present, even when doing `make > > distclean` and then `make bootstrap` after re-running `./configure`. > > > > `toggle-debug-on-error` gives me: > > > > ``` > > Debugger entered--Lisp error: (file-error "Opening input file" "Is a > directory" "c:/Users/sonictk/tmp") > > eglot--xref-make-match(#("Baz" 0 3 (face font-lock-function-name-face > fontified t)) > > "file:///c:/Users/sonictk/tmp/test2.cpp" (:end (:character 11 :line 23) > :start (:character 8 :line 23))) > > #f(compiled-function (loc-or-loc-link) # 0x413eb090fd3d661>)((:range (:end (:character 11 :line > > 23) :start (:character 8 :line 23)) :uri " > file:///c:/Users/sonictk/tmp/test2.cpp")) > > eglot--lsp-xrefs-for-method(:textDocument/definition) > > #f(compiled-function (backend id) # -0x10624bec505aa107>)(eglot "LSP identifier at point") > > apply(#f(compiled-function (backend id) # -0x10624bec505aa107>) eglot "LSP identifier at > > point") > > xref-backend-definitions(eglot "LSP identifier at point") > > #f(compiled-function () #)() > > xref-show-definitions-buffer(#f(compiled-function () # 0x558a9dc3551d156>) ((window . > > #) (display-action) (auto-jump))) > > xref--show-defs(#f(compiled-function () #= ) > nil) > > xref--find-definitions("LSP identifier at point" nil) > > xref-find-definitions("LSP identifier at point") > > funcall-interactively(xref-find-definitions "LSP identifier at point"= ) > > command-execute(xref-find-definitions) > > ``` > > Thanks. Does the patch below give good results? > > Jo=C3=A3o, I think the assumption that 'retval' there necessarily starts > with a slash is because url-generic-parse-url would not necessarily > DTRT with Windows file:// URIs; it was fixed lately. So now we need > to test for that before applying the fixup. > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index eae8e1b..6f6b05a 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -1165,7 +1165,8 @@ eglot-uri-to-path > ;; Remove the leading "/" for local MS Windows-style path= s. > (normalized (if (and (not remote-prefix) > (eq system-type 'windows-nt) > - (cl-plusp (length retval))) > + (cl-plusp (length retval)) > + (eq (aref retval 0) ?/)) > (w32-long-file-name (substring retval 1)) > retval))) > (concat remote-prefix normalized)) > > --0000000000005e85b70634f5e87e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks. I think the patch makes sense. Free to push.= If you can, please prefix the first line of commit message with "Eglo= t: ", like the other ones to this file.

Jo=C3=A3o

On Mon, = May 12, 2025, 20:57 admin@sonictk.com<= /a> <admin@sonictk.com> wrot= e:
Hi Eli:

Thanks for responding. Confirmed that applying the patch locally solves the= issue. Appreciate the help here!



From: = Eli Zaretskii <eliz@gnu.org>
Sent: Monday, May 12, 2025 8:16 AM
To: admin@sonictk.com <admin@sonictk.com>; Jo=C3=A3o T= =C3=A1vora <joaotavora@gmail.com>
Cc: 78392@debbugs.gnu.org <78392@debbugs.gnu.org&= gt;
Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitio= ns
=C2=A0
> From: "admin@sonictk.com" <admin@sonictk.com&g= t;
> Date: Mon, 12 May 2025 06:29:15 +0000
>
> Currently, when building from latest Emacs ToT, activating `eglot-mode= `
> in any C++ file using `clangd` and attempting to call
> `xref-find-definitions` on any definition results in the following err= or
> being triggered:
>
> ```
> Opening input file: Is a directory, c:/Users/sonictk/tmp
> ```
>
> Where the `.cpp` file is in the given directory. Tried building Emacs<= br> > using a build from a month-ish ago to find where the regression first<= br> > occurred and it still had the issue present, even when doing `make
> distclean` and then `make bootstrap` after re-running `./configure`. >
> `toggle-debug-on-error` gives me:
>
> ```
> Debugger entered--Lisp error: (file-error "Opening input file&quo= t; "Is a directory" "c:/Users/sonictk/tmp")
>=C2=A0=C2=A0 eglot--xref-make-match(#("Baz" 0 3 (face font-lo= ck-function-name-face fontified t))
> "file:///c:/Users/sonictk/tmp/test2.cpp= " (:end (:character 11 :line 23) :start (:character 8 :line 23)))
>=C2=A0=C2=A0 #f(compiled-function (loc-or-loc-link) #<bytecode 0x413= eb090fd3d661>)((:range (:end (:character 11 :line
> 23) :start (:character 8 :line 23)) :uri "f= ile:///c:/Users/sonictk/tmp/test2.cpp"))
>=C2=A0=C2=A0 eglot--lsp-xrefs-for-method(:textDocument/definition)
>=C2=A0=C2=A0 #f(compiled-function (backend id) #<bytecode -0x10624be= c505aa107>)(eglot "LSP identifier at point")
>=C2=A0=C2=A0 apply(#f(compiled-function (backend id) #<bytecode -0x1= 0624bec505aa107>) eglot "LSP identifier at
> point")
>=C2=A0=C2=A0 xref-backend-definitions(eglot "LSP identifier at poi= nt")
>=C2=A0=C2=A0 #f(compiled-function () #<bytecode 0x558a9dc3551d156>= ;)()
>=C2=A0=C2=A0 xref-show-definitions-buffer(#f(compiled-function () #<= bytecode 0x558a9dc3551d156>) ((window .
> #<window 9 on test2.cpp>) (display-action) (auto-jump)))
>=C2=A0=C2=A0 xref--show-defs(#f(compiled-function () #<bytecode 0x55= 8a9dc3551d156>) nil)
>=C2=A0=C2=A0 xref--find-definitions("LSP identifier at point"= nil)
>=C2=A0=C2=A0 xref-find-definitions("LSP identifier at point")=
>=C2=A0=C2=A0 funcall-interactively(xref-find-definitions "LSP iden= tifier at point")
>=C2=A0=C2=A0 command-execute(xref-find-definitions)
> ```

Thanks.=C2=A0 Does the patch below give good results?

Jo=C3=A3o, I think the assumption that 'retval' there necessarily s= tarts
with a slash is because url-generic-parse-url would not necessarily
DTRT with Windows file:// URIs; it was fixed lately.=C2=A0 So now we need to test for that before applying the fixup.

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index eae8e1b..6f6b05a 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1165,7 +1165,8 @@ eglot-uri-to-path
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 ;; Remove the leading "/" for local MS Windows-st= yle paths.
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (normalized (if (and (not remote-prefix)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (eq syst= em-type 'windows-nt)
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cl-plusp (= length retval)))
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cl-plusp (= length retval))
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (eq (aref r= etval 0) ?/))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (w32-long-file-name (substring retval = 1))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 retval)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (concat remote= -prefix normalized))

--0000000000005e85b70634f5e87e-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 13 00:19:10 2025 Received: (at 78392) by debbugs.gnu.org; 13 May 2025 04:19:11 +0000 Received: from localhost ([127.0.0.1]:56909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEh6j-0007e7-PL for submit@debbugs.gnu.org; Tue, 13 May 2025 00:19:10 -0400 Received: from bonobo.banana.relay.mailchannels.net ([23.83.217.22]:15903) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEZHJ-0006Nt-OO for 78392@debbugs.gnu.org; Mon, 12 May 2025 15:57:34 -0400 X-Sender-Id: dreamhost|x-authsender|admin@sonictk.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C1D2C21A28; Mon, 12 May 2025 19:57:31 +0000 (UTC) Received: from pdx1-sub0-mail-a232.dreamhost.com (trex-green-6.trex.outbound.svc.cluster.local [100.119.91.76]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3E5662726F; Mon, 12 May 2025 19:57:31 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1747079851; a=rsa-sha256; cv=none; b=aH/mPYmOJqWKFJAHbd6or4j2t+zSKWW+XI+amZciFlabpafArIoNutzU8PQlrn/mYf3ztJ AX5oc7RrgSTk4iNzXxbdkprcJlTvC2xbcLwPkZ8njIguFmpymv7K3rNuCZMETyJryt0nBg raShzBuqGV1DKC6JHZYjp9j3cbtGJYIZ8+GHJNQJ0km/Pb/WuXV4o/g1NS/oSzJ09ZKKIR uECe82LmXBegwesb+GaqC8rfGnH0teV2+eiysBL/r0SYzYHU7ZypCC47QuGCRdH/o8wAzN 1nfLVeREqUFKYraDlNRxMLIUDLEM/8Wc5HBrvrpMqRtjUGt6btuqNZQ+y9mizg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1747079851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HCRk8HKXjYtJKDfVhsfYsdXx+6NmIEPRivPVfkR4GVU=; b=PDyjjnwIeyqbBC3hvFHQa6LuU6TOp1jrQzEPMZQtvNk2lQIYV1T6j/Rv+RJYnmaGYDfoQf DTWT2ETg1MAjVzYPlmazlmd/1b5OigG+GSkht+m1KHjE8D1qjoR0Hp2mwHpHl0bIuueYiG sYnXBlnUxxo9r+sEwhRgMpwWKCrwdVWlbxHhrjf/Mmm4Gd/rhFuZStJU3PkcBRjjod/nHZ txwyd6hZCsKX9x88MF+NNoJ0KsLwKPGZz+MCPfteDORyW0qfCrM1OrP6IT8SFg+prpPShX Avub744Jw9P6orG+GPYGN6hyk/SW6d6fUNncvZ+Xjs86hYkpUTOXzdNpcxAs9g== ARC-Authentication-Results: i=1; rspamd-57f676fcfb-xl9g7; auth=pass smtp.auth=dreamhost smtp.mailfrom=admin@sonictk.com X-Sender-Id: dreamhost|x-authsender|admin@sonictk.com X-MC-Relay: Bad X-MailChannels-SenderId: dreamhost|x-authsender|admin@sonictk.com X-MailChannels-Auth-Id: dreamhost X-Hysterical-Chemical: 5c1d948942b7c2cb_1747079851490_3591051313 X-MC-Loop-Signature: 1747079851490:2708587923 X-MC-Ingress-Time: 1747079851490 Received: from pdx1-sub0-mail-a232.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.119.91.76 (trex/7.0.3); Mon, 12 May 2025 19:57:31 +0000 Received: from MN2PR20MB3133.namprd20.prod.outlook.com (unknown [52.96.64.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: admin@sonictk.com) by pdx1-sub0-mail-a232.dreamhost.com (Postfix) with ESMTPSA id 4Zx9PQ6FW3z9q; Mon, 12 May 2025 12:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sonictk.com; s=dreamhost; t=1747079851; bh=HCRk8HKXjYtJKDfVhsfYsdXx+6NmIEPRivPVfkR4GVU=; h=From:To:CC:Subject:Date:Content-Type; b=jIZ7VtsQWeiB5Y+L1tfz6gGHt8ZXlXx0riGQW7DbQaj96PBh6rbk064lon+Ms2IYe wBiO8Ud3k5vFs8XDjhRluGHvYsbv9NQ8Km1+xLNl92X1xUtETGobTyHz2j38cXAYIK WfauIIGYu7DgnpbJ9PL1LikvZsGteQF5q4jN7jiifpYstf/kDyrIHLvuJ0G3YeLBj4 PPCvjKCuq3YcuIHcycs6px6ao2gTs3oJEDOul3/f1lSHzr9hw5Lwhv8p3qNBiQn6CS TpoBaRJQ4ORd23twMPOOULFu86urg9GzvJv7uT1DBdBSSd3P5+rheb0PrK6A2LaFIz PQy3IqrEQzpGA== From: "admin@sonictk.com" To: Eli Zaretskii , =?iso-8859-1?Q?Jo=E3o_T=E1vora?= Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitions Thread-Topic: bug#78392: 31.0.50; eglot breaks on xref-find-definitions Thread-Index: AQHbwwccNL5aBxVh/02jhNLyG3tFuEFCRTYzZmY3dHiukgwXhA== X-MS-Exchange-MessageSentRepresentingType: 1 Date: Mon, 12 May 2025 19:57:30 +0000 Message-ID: References: <86bjrx7tb7.fsf@gnu.org> In-Reply-To: <86bjrx7tb7.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-Exchange-Organization-SCL: -1 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 msip_labels: Content-Type: multipart/alternative; boundary="_000_MN2PR20MB3133540B98F548FACA3F1906AB97AMN2PR20MB3133namp_" MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78392 X-Mailman-Approved-At: Tue, 13 May 2025 00:19:06 -0400 Cc: "78392@debbugs.gnu.org" <78392@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 (-) --_000_MN2PR20MB3133540B98F548FACA3F1906AB97AMN2PR20MB3133namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Eli: Thanks for responding. Confirmed that applying the patch locally solves the= issue. Appreciate the help here! ________________________________ From: Eli Zaretskii Sent: Monday, May 12, 2025 8:16 AM To: admin@sonictk.com ; Jo=E3o T=E1vora Cc: 78392@debbugs.gnu.org <78392@debbugs.gnu.org> Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitions > From: "admin@sonictk.com" > Date: Mon, 12 May 2025 06:29:15 +0000 > > Currently, when building from latest Emacs ToT, activating `eglot-mode` > in any C++ file using `clangd` and attempting to call > `xref-find-definitions` on any definition results in the following error > being triggered: > > ``` > Opening input file: Is a directory, c:/Users/sonictk/tmp > ``` > > Where the `.cpp` file is in the given directory. Tried building Emacs > using a build from a month-ish ago to find where the regression first > occurred and it still had the issue present, even when doing `make > distclean` and then `make bootstrap` after re-running `./configure`. > > `toggle-debug-on-error` gives me: > > ``` > Debugger entered--Lisp error: (file-error "Opening input file" "Is a dire= ctory" "c:/Users/sonictk/tmp") > eglot--xref-make-match(#("Baz" 0 3 (face font-lock-function-name-face f= ontified t)) > "file:///c:/Users/sonictk/tmp/test2.cpp" (:end (:character 11 :line 23) := start (:character 8 :line 23))) > #f(compiled-function (loc-or-loc-link) #)((= :range (:end (:character 11 :line > 23) :start (:character 8 :line 23)) :uri "file:///c:/Users/sonictk/tmp/te= st2.cpp")) > eglot--lsp-xrefs-for-method(:textDocument/definition) > #f(compiled-function (backend id) #)(eglo= t "LSP identifier at point") > apply(#f(compiled-function (backend id) #= ) eglot "LSP identifier at > point") > xref-backend-definitions(eglot "LSP identifier at point") > #f(compiled-function () #)() > xref-show-definitions-buffer(#f(compiled-function () #) ((window . > #) (display-action) (auto-jump))) > xref--show-defs(#f(compiled-function () #) = nil) > xref--find-definitions("LSP identifier at point" nil) > xref-find-definitions("LSP identifier at point") > funcall-interactively(xref-find-definitions "LSP identifier at point") > command-execute(xref-find-definitions) > ``` Thanks. Does the patch below give good results? Jo=E3o, I think the assumption that 'retval' there necessarily starts with a slash is because url-generic-parse-url would not necessarily DTRT with Windows file:// URIs; it was fixed lately. So now we need to test for that before applying the fixup. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index eae8e1b..6f6b05a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1165,7 +1165,8 @@ eglot-uri-to-path ;; Remove the leading "/" for local MS Windows-style paths. (normalized (if (and (not remote-prefix) (eq system-type 'windows-nt) - (cl-plusp (length retval))) + (cl-plusp (length retval)) + (eq (aref retval 0) ?/)) (w32-long-file-name (substring retval 1)) retval))) (concat remote-prefix normalized)) --_000_MN2PR20MB3133540B98F548FACA3F1906AB97AMN2PR20MB3133namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Eli:

Thanks for responding. Confirmed that applying the patch locally solves the= issue. Appreciate the help here!



From: Eli Zaretskii <eli= z@gnu.org>
Sent: Monday, May 12, 2025 8:16 AM
To: admin@sonictk.com <admin@sonictk.com>; Jo=E3o T=E1vora <= ;joaotavora@gmail.com>
Cc: 78392@debbugs.gnu.org <78392@debbugs.gnu.org>
Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitio= ns
 
> From: "admin@sonictk.com" <admin= @sonictk.com>
> Date: Mon, 12 May 2025 06:29:15 +0000
>
> Currently, when building from latest Emacs ToT, activating `eglot-mode= `
> in any C++ file using `clangd` and attempting to call
> `xref-find-definitions` on any definition results in the following err= or
> being triggered:
>
> ```
> Opening input file: Is a directory, c:/Users/sonictk/tmp
> ```
>
> Where the `.cpp` file is in the given directory. Tried building Emacs<= br> > using a build from a month-ish ago to find where the regression first<= br> > occurred and it still had the issue present, even when doing `make
> distclean` and then `make bootstrap` after re-running `./configure`. >
> `toggle-debug-on-error` gives me:
>
> ```
> Debugger entered--Lisp error: (file-error "Opening input file&quo= t; "Is a directory" "c:/Users/sonictk/tmp")
>   eglot--xref-make-match(#("Baz" 0 3 (face font-lo= ck-function-name-face fontified t))
> "file:///c:/Us= ers/sonictk/tmp/test2.cpp" (:end (:character 11 :line 23) :start (= :character 8 :line 23)))
>   #f(compiled-function (loc-or-loc-link) #<bytecode 0x413= eb090fd3d661>)((:range (:end (:character 11 :line
> 23) :start (:character 8 :line 23)) :uri "file:///c:/Users/sonictk/tmp/test2.cpp"= ;))
>   eglot--lsp-xrefs-for-method(:textDocument/definition)
>   #f(compiled-function (backend id) #<bytecode -0x10624be= c505aa107>)(eglot "LSP identifier at point")
>   apply(#f(compiled-function (backend id) #<bytecode -0x1= 0624bec505aa107>) eglot "LSP identifier at
> point")
>   xref-backend-definitions(eglot "LSP identifier at poi= nt")
>   #f(compiled-function () #<bytecode 0x558a9dc3551d156>= ;)()
>   xref-show-definitions-buffer(#f(compiled-function () #<= bytecode 0x558a9dc3551d156>) ((window .
> #<window 9 on test2.cpp>) (display-action) (auto-jump)))
>   xref--show-defs(#f(compiled-function () #<bytecode 0x55= 8a9dc3551d156>) nil)
>   xref--find-definitions("LSP identifier at point"= nil)
>   xref-find-definitions("LSP identifier at point")=
>   funcall-interactively(xref-find-definitions "LSP iden= tifier at point")
>   command-execute(xref-find-definitions)
> ```

Thanks.  Does the patch below give good results?

Jo=E3o, I think the assumption that 'retval' there necessarily starts
with a slash is because url-generic-parse-url would not necessarily
DTRT with Windows file:// URIs; it was fixed lately.  So now we need to test for that before applying the fixup.

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index eae8e1b..6f6b05a 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1165,7 +1165,8 @@ eglot-uri-to-path
            &nb= sp;   ;; Remove the leading "/" for local MS Windows-st= yle paths.
            &nb= sp;   (normalized (if (and (not remote-prefix)
            &nb= sp;            =             (eq syst= em-type 'windows-nt)
-            &n= bsp;            = ;           (cl-plusp (le= ngth retval)))
+            &n= bsp;            = ;           (cl-plusp (le= ngth retval))
+            &n= bsp;            = ;           (eq (aref ret= val 0) ?/))
            &nb= sp;            =        (w32-long-file-name (substring retval = 1))
            &nb= sp;            =      retval)))
           (concat remote= -prefix normalized))

--_000_MN2PR20MB3133540B98F548FACA3F1906AB97AMN2PR20MB3133namp_-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 13 07:47:59 2025 Received: (at 78392-done) by debbugs.gnu.org; 13 May 2025 11:47:59 +0000 Received: from localhost ([127.0.0.1]:58387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEo74-0000mC-Pt for submit@debbugs.gnu.org; Tue, 13 May 2025 07:47:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42900) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEo71-0000lw-VO for 78392-done@debbugs.gnu.org; Tue, 13 May 2025 07:47:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEo6w-00025L-1z; Tue, 13 May 2025 07:47:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=yRtJT7e8j0jFCFqCHl9sJZd/ksceA5u1C8W9952tQOY=; b=OQgwZ2jppnOjwuJrUdeV FtOuC1xb2x9S5McnmmG73u/R6pQFdj6BmYe4tQDTgaPaF/nD4r8PT4COQMMem8SK4+wkNOlLE3whD jqyUJ1lncA4af+NakfjLw1OVRm7H9AlirruqL8/QSMSk3UsCPv4jVjqj+8tY1eve2ov24UabV7zXA 9EIM1s3sNWA/nw6dx75ePgxlGrByfKL/FfjYlwvNiPzXRdLgJRNcfdjkfCfaYtDWr2XsSH2M5RV0h 0++Wtu/j0uVpa0zwp93s1DVtt6hLgziLZf28N4CYLTIN64DJl885CmlPtVk86pzPIwIpC/i2vBzv8 3aBB6dS3hAuayQ==; Date: Tue, 13 May 2025 14:47:46 +0300 Message-Id: <861pss7mvx.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Mon, 12 May 2025 21:10:21 +0100) Subject: Re: bug#78392: 31.0.50; eglot breaks on xref-find-definitions References: <86bjrx7tb7.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78392-done Cc: 78392-done@debbugs.gnu.org, admin@sonictk.com 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: -3.3 (---) > From: João TÔvora > Date: Mon, 12 May 2025 21:10:21 +0100 > Cc: Eli Zaretskii , 78392@debbugs.gnu.org > > Thanks. I think the patch makes sense. Free to push. If you can, please prefix the first line of commit > message with "Eglot: ", like the other ones to this file. Thanks, done, and closing the bug. From unknown Fri Jun 20 07:19:00 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 11 Jun 2025 11:24:14 +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