bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58790: Eglot URI parsing bug when using clojure-lsp server


From: Juri Linkov
Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Tue, 01 Nov 2022 19:25:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> 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))
```





reply via email to

[Prev in Thread] Current Thread [Next in Thread]