all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Filippo Argiolas <filippo.argiolas@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 64608@debbugs.gnu.org
Subject: bug#64608: 29.0.90; Eglot: reuse server when visiting external files
Date: Sat, 15 Jul 2023 09:30:47 +0200	[thread overview]
Message-ID: <CAOdrLGLh7-YJqhnFTOOvzV9m9OearavS__pdnnOdRdJaXujSsA@mail.gmail.com> (raw)
In-Reply-To: <CALDnm53adVHgX=BapXmLVSJNa98vMt3+-4UGPG3VFM8e6owJcw@mail.gmail.com>

Il giorno ven 14 lug 2023 alle ore 16:00 João Távora
<joaotavora@gmail.com> ha scritto:
> Fillipo, to fully understand your use case and what's missing I need you to create a structural example of those related projects, closely representative of the real one, pack it as a zip or a reference to a Git repository, in a way that I can experience the same limitation you are experiencing myself. Is the server you are using Clangd? If so, say the version.

I tried to setup a minimal work dir to show you what I'd like to obtain.

https://people.freedesktop.org/~fargiolas/eglot-external-test-case.tar.gz

It's configured (compile db and dir locals) to be unpacked inside /tmp/

Inside you will find three dirs:
- foo and bar are normal projects
- ext contains shared code that can be compiled only when paired with
one or the other project.

ext is is added as an external root to each of the projects with .dir-locals.el
foo and bar include compile_commands.json that build both the project
and the external code. Each project builds the external code
differently (e.g. by setting different defines).

Only relevant settings in init.el are:
(add-hook 'c-mode-hook 'eglot-ensure)
(setq eglot-extend-to-xref t)

emacs 29.0.90
clangd 6.0.6

With eglot-extend-to-xref I can jump from foo/main.c into ext
functions while keeping the same active clangd server (eglot:foo in
the modeline).
If I open foo/main.c and then visit ext/ext.c with
project-or-external-find-file or project-or-external-find-regexp it
switches to a new clangd instance (eglot:ext in the modeline) as it
detects ext/ as its own project.

What I'd like is to keep the same clangd instance if I'm visiting and
external file in a similar way that xref does.
Is it something achievable in current eglot? may be something I should
configure about workspaces?

Thanks!
Filippo





  reply	other threads:[~2023-07-15  7:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  5:51 bug#64608: 29.0.90; Eglot: reuse server when visiting external files Filippo Argiolas
2023-07-14 10:38 ` Eli Zaretskii
2023-07-14 13:55   ` Filippo Argiolas
2023-07-14 14:00   ` João Távora
2023-07-15  7:30     ` Filippo Argiolas [this message]
2023-07-15  7:32       ` Filippo Argiolas

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

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

  git send-email \
    --in-reply-to=CAOdrLGLh7-YJqhnFTOOvzV9m9OearavS__pdnnOdRdJaXujSsA@mail.gmail.com \
    --to=filippo.argiolas@gmail.com \
    --cc=64608@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joaotavora@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.