GNU bug report logs - #58790
Eglot URI parsing bug when using clojure-lsp server

Previous Next

Package: emacs;

Reported by: Danny Freeman <danny <at> dfreeman.email>

Date: Wed, 26 Oct 2022 05:08:04 UTC

Severity: normal

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 58790 <at> debbugs.gnu.org, João Távora <joaotavora <at> gmail.com>, Danny Freeman <danny <at> dfreeman.email>, Stefan Kangas <stefankangas <at> gmail.com>
Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Tue, 01 Nov 2022 19:25:48 +0200
>> Please read the summary of the outlined above.  Maybe there's nothing to
>> be done in project.el if eglot-extend-to-xref is to be used.
>
> Having the jars in project-external-roots could enable the users (after
> certain integration work) to search across their contents with
> project-or-external-find-regexp, or jump to files inside with
> project-or-external-find-file.

FWIW, here's a possible way how to get everything to work,
so that 'C-x p G' works either when a file is visited
in a project dir or in a lib dir, and eglot is connected
to the project server by visiting any file in the lib dir
(that eglot-extend-to-xref can't do):

```
(defvar my-project-dir "...")
(defvar my-lib-dir "...")
(add-hook 'prog-mode-hook
          (lambda ()
            (when (string-match-p my-project-dir default-directory)
              (setq-local project-vc-external-roots-function
                          (lambda () (list my-lib-dir)))
              (eglot-ensure))))

(defun my-project-try-lib (dir)
  (when (string-match-p my-lib-dir dir)
    (if (bound-and-true-p eglot-lsp-context)
        ;; for eglot.el
        `(vc Git ,my-project-dir)
      ;; for project.el
      `(transient . ,my-lib-dir))))

(with-eval-after-load 'project
  (add-to-list 'project-find-functions 'my-project-try-lib))
```




This bug report was last modified 2 years and 166 days ago.

Previous Next


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