From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server Date: Tue, 01 Nov 2022 19:25:48 +0200 Organization: LINKOV.NET Message-ID: <8635b2li4z.fsf@mail.linkov.net> References: <8cf8ba5d-c604-b2dc-274a-7597b19fb73f@dfreeman.email> <87ilk5xq01.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25312"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 58790@debbugs.gnu.org, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , Danny Freeman , Stefan Kangas To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 01 18:38:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opvDW-0006RY-Jl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Nov 2022 18:38:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opvDB-0006Ng-2v; Tue, 01 Nov 2022 13:38:05 -0400 Original-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 1opvD9-0006Mo-KX for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 13:38:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opvD9-0000R9-Cw for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 13:38:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opvD9-0002XI-98 for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 13:38:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Nov 2022 17:38:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58790 X-GNU-PR-Package: emacs Original-Received: via spool by 58790-submit@debbugs.gnu.org id=B58790.16673242489639 (code B ref 58790); Tue, 01 Nov 2022 17:38:03 +0000 Original-Received: (at 58790) by debbugs.gnu.org; 1 Nov 2022 17:37:28 +0000 Original-Received: from localhost ([127.0.0.1]:44156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opvCZ-0002VO-Oy for submit@debbugs.gnu.org; Tue, 01 Nov 2022 13:37:27 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:56891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opvCY-0002Uz-71 for 58790@debbugs.gnu.org; Tue, 01 Nov 2022 13:37:27 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 62DA41BF205; Tue, 1 Nov 2022 17:37:16 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Sat, 29 Oct 2022 04:22:43 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246794 Archived-At: >> 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)) ```