GNU bug report logs -
#58790
Eglot URI parsing bug when using clojure-lsp server
Previous Next
Full log
View this message in rfc822 format
>> 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.