GNU bug report logs -
#64608
29.0.90; Eglot: reuse server when visiting external files
Previous Next
Full log
Message #14 received at 64608 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Il ven 14 lug 2023, 12:38 Eli Zaretskii <eliz <at> gnu.org> ha scritto:
> > From: Filippo Argiolas <filippo.argiolas <at> gmail.com>
> > Date: Fri, 14 Jul 2023 07:51:28 +0200
> >
> > Hi,
> >
> > I'm working on a couple of projects each with their main root and all
> > sharing some common code in an external root dir.
> >
> > Each project has a compile_commands.json that knows how to compile the
> > external shared code. External root has no compile db and doesn't know
> > how to compile itself.
> >
> > Eglot currently allows me to jump to external files using xref while
> > keeping the current active running server by setting
> > eglot-extend-to-xref.
> >
> > Project.el allows me to visit external files using project-or-external-
> > functions by defining project-external-roots on my custom backend or
> > project-vc-external-roots-functions with the default backend.
> >
> > It would be great if I configure Eglot to not switch to a new server
> > when visiting an external file in a similar way it does with xref.
> >
> > Any pointer to achieve something like this with current project.el and
> > eglot code would also be great. Maybe with a custom project backend?
>
> Sorry, I don't understand: AFAIU Eglot reuses the same server for all
> the buffers under the same major-mode, so you should already have what
> you want? Or what am I missing?
>
> Adding João to this discussion.
>
I could be misusing the word server here, what I'm seeing is a clangd
instance for each project. Each with its own hidden stdout/stderr buffer.
Not sure if they're actually different processes, far from the laptop at
the moment and cannot check, but I guess so.
When I visit a file in a new project it starts a new clangd instance
associated to its root dir and its compile db if it exists. All buffers
from the same project share the same instance. Not sure what happens with
different major modes as I'm using c-mode only.
What I'd like is to reuse the same instance and the same compile db if I'm
visiting an external file from project-or-external- functions.
Filippo
[Message part 2 (text/html, inline)]
This bug report was last modified 2 years and 35 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.