From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filippo Argiolas Newsgroups: gmane.emacs.bugs Subject: bug#64608: 29.0.90; Eglot: reuse server when visiting external files Date: Sat, 15 Jul 2023 09:30:47 +0200 Message-ID: References: <837cr24w1y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30349"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 64608@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 15 11:45:13 2023 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 1qKbpx-0007f3-6A for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jul 2023 11:45:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKbpo-0008Gb-Rx; Sat, 15 Jul 2023 05:45:04 -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 1qKbpn-0008Ff-0d for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 05:45:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKbpm-0006nk-Oe for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 05:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKbpm-0004mo-KG for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 05:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filippo Argiolas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jul 2023 09:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64608 X-GNU-PR-Package: emacs Original-Received: via spool by 64608-submit@debbugs.gnu.org id=B64608.168941425718288 (code B ref 64608); Sat, 15 Jul 2023 09:45:02 +0000 Original-Received: (at 64608) by debbugs.gnu.org; 15 Jul 2023 09:44:17 +0000 Original-Received: from localhost ([127.0.0.1]:44184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKbp3-0004ku-4K for submit@debbugs.gnu.org; Sat, 15 Jul 2023 05:44:17 -0400 Original-Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]:54771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKZk9-0000v0-EG for 64608@debbugs.gnu.org; Sat, 15 Jul 2023 03:31:05 -0400 Original-Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3a43cbb4343so1027202b6e.1 for <64608@debbugs.gnu.org>; Sat, 15 Jul 2023 00:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689406259; x=1691998259; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=V0hAd97CUtP+eyy4PGYW+g0gLx53LWLJ0/38NwQ4SzM=; b=qlbQZmJYIGp5A7QhXWUZKMerpSv1dlEpyFdbBItd0n1q/tGKi1yW+i68Htj2QPKhR3 Fssb/4YCUbz5sXEz4AEUrqn38Qx6Uj+PpzDheB8NJahxRJ7XGA7FTbzGWkxhMBujon5n pApXu1BJkxDW+IyiU4BWm+PS2RG3l4p3bkjIDzRof3V0pOUOIqtnqnw5Blrp94qYtb7b SzJsde/L8YnNes1XnREW2P//cVBhT3fwYpVndeMlFBXF4F+0u/HMpfKLLWJOIIahdiqH ZMlgznE/9eHapoOgtXaKVAGBHGJQsHPzHIhZJOneTrBVEmp0Md8+uDhLXal/zLoG+d8K t8wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689406259; x=1691998259; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V0hAd97CUtP+eyy4PGYW+g0gLx53LWLJ0/38NwQ4SzM=; b=ahhJtW7oUxH+6ZzsdxE1Z+ChiouG+FPuSzD5AeFPnsJfuSWagyfVbb1S9dyA6l1VDG /CnG2rMHfP/jQvL2yHMQQbop6o5azmIkNw5lgpfsvvGCXyds1pxs7CmQGUQxRuBXFMk8 akQbUdW1knrWa1Dwq2vgFRw52yKuTjFtEUTsP60/Dei7uMhsDg4AzxHL91NpgKCeq3HT jFEV3FIGSHTpw7SOlqbHd8wrUPeWVvu0yNFZvevLbIWPMKExfzPy09zUq3DcRylkwNp7 fqnlvLU+244rt1GACGWZBjV9Utx16D9EX8KpyiDhbxucnSRCyHzVivqekdJAyJ308Lk7 OUDw== X-Gm-Message-State: ABy/qLYtyfsaZIVtYpnYFsBER1O52/aNk6QjYA3iUmQgidw4kP+cbtxq gNhx+87LmMfS1jvhrQtah91d8AsXtzCApFe+g1Q= X-Google-Smtp-Source: APBJJlFpHTWhYR2PPjQ4BfrEzOn1c9fTnS50BUy42UI2oqG34noc/hOujuRw3dDzkL/ujA1tyTwB/NuZ/mgqjT+GLIY= X-Received: by 2002:a05:6808:1382:b0:3a4:3d81:6857 with SMTP id c2-20020a056808138200b003a43d816857mr5094678oiw.40.1689406259075; Sat, 15 Jul 2023 00:30:59 -0700 (PDT) In-Reply-To: X-Mailman-Approved-At: Sat, 15 Jul 2023 05:44:16 -0400 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265182 Archived-At: Il giorno ven 14 lug 2023 alle ore 16:00 Jo=C3=A3o T=C3=A1vora 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 represent= ative 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 my= self. 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-local= s.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