unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: "Ship Mints" <shipmints@gmail.com>,
	72701@debbugs.gnu.org, "João Távora" <joaotavora@gmail.com>
Subject: bug#72701: eglot crash when project-files-relative-names t
Date: Fri, 23 Aug 2024 02:22:52 +0300	[thread overview]
Message-ID: <c38c4ff9-ede3-4e7f-a4af-0446ae5da43d@gutov.dev> (raw)
In-Reply-To: <CAN+1HbrswP1WVBWsKPvXxcFwmV-VE0y3270CG_N2ScViTHWcBw@mail.gmail.com>

Hi!

On 18/08/2024 18:43, Ship Mints wrote:
> project-files-relative-names was introduced a few months ago, so it's no 
> surprise that there are some side effects when set.
> 
> This affects the handler for workspace/didChangeWatchedFiles. The result 
> is that dirs-to-watch...
> 
>           (dirs-to-watch
>            (delete-dups (mapcar #'file-name-directory
>                                 (project-files
>                                  (eglot--project server))))))
> 
> ...is nil when project-files-relative-names is t, due to 
> file-name-directory failing to parse the directories it was expecting. 
> This results in file-readable-p failing with a nil dir:

You're not really supposed to customize it as an end user (or at least 
not yet) - the caller code either sets it to t to indicate support for 
relative names, or not.

>           (watch-dir (dir)
>             (when-let ((probe
>                         (and (file-readable-p dir)
> 
> One solution which I've tested is simply the defensive:
> 
>           (project-files-relative-names nil) ; add this
>           (dirs-to-watch
>            (delete-dups (mapcar #'file-name-directory
>                                 (project-files
>                                  (eglot--project server))))))

...that said, someday the default value of this var will be flipped, and 
some changes like that might be needed.

The relative version is a bit faster, though, so maybe Eglot could 
switch to relative names too. If it makes sense.





  parent reply	other threads:[~2024-08-22 23:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-18 15:43 bug#72701: eglot crash when project-files-relative-names t Ship Mints
2024-08-22 17:04 ` Ship Mints
2024-08-22 17:52   ` Eli Zaretskii
2024-08-22 17:53     ` Ship Mints
2024-08-22 20:38     ` João Távora
2024-08-23 15:07       ` Ship Mints
2024-08-23 22:49         ` João Távora
2024-08-22 23:22 ` Dmitry Gutov [this message]
2024-08-23 14:56   ` Ship Mints
2024-08-23 15:08     ` João Távora
2024-08-23 15:10       ` Ship Mints
2024-08-23 23:51       ` Dmitry Gutov
2024-09-07  7:20         ` Eli Zaretskii
2024-09-08  2:24           ` Dmitry Gutov
2024-09-08 10:56             ` João Távora
2024-09-08 20:51               ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c38c4ff9-ede3-4e7f-a4af-0446ae5da43d@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=72701@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=shipmints@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).