From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70408: 30.0.50; Eglot and Project integration Date: Tue, 16 Apr 2024 23:51:21 +0200 Message-ID: <6mr2uvovmws5qbowuqnh332tncdueanvxbucsoazzoykjythsf@k5eo2mzccf5w> References: <87o7aas3sk.fsf.ref@aol.com> <87o7aas3sk.fsf@aol.com> <86le5djzz2.fsf@gnu.org> <8cfba95b-fedd-4b5f-9778-d656601006d1@gutov.dev> <3i7r7yspjdbjtlyrc6ry3vi4rbsxvm52axyehk3dn4ykjltndh@aqizn4e6dflm> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1535"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , Eli Zaretskii , 70408@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 Tue Apr 16 23:52:08 2024 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 1rwqil-00004u-ST for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Apr 2024 23:52:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwqiX-0007VC-BC; Tue, 16 Apr 2024 17:51:53 -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 1rwqiU-0007TQ-0W for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 17:51:50 -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 1rwqiT-0003Xs-NP for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 17:51:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwqig-0004yG-6M for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 17:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Apr 2024 21:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70408 X-GNU-PR-Package: emacs Original-Received: via spool by 70408-submit@debbugs.gnu.org id=B70408.171330430719054 (code B ref 70408); Tue, 16 Apr 2024 21:52:02 +0000 Original-Received: (at 70408) by debbugs.gnu.org; 16 Apr 2024 21:51:47 +0000 Original-Received: from localhost ([127.0.0.1]:45267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwqiR-0004xG-8l for submit@debbugs.gnu.org; Tue, 16 Apr 2024 17:51:47 -0400 Original-Received: from sonic311-14.consmr.mail.bf2.yahoo.com ([74.6.131.124]:37341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwqiO-0004wF-Op for 70408@debbugs.gnu.org; Tue, 16 Apr 2024 17:51:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1713304286; bh=cBn/90TO5rbqhoUzTnmbcL9Ud++Quna/mOCaJfxeAoU=; h=Date:From:To:Cc:Subject:References:In-Reply-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N_ZiOZXlu7LJXvi_wQ E.OLn7QVRw8aD0IS_4n.4LJUSDTCwnGNf1Em_MBLCFsmLowJvQevRh_2E21FjKNoIJSrZh96cPsU pjURlLDwL.FHz.PFndA0VLCXZtKdvKZqtVk0yeXddbTnlsaEsfQJGuFriwayBHVxt2lARwSc2tID _nmhzZcm47Si53ZMlBGAJfEHQNSxmsQJz3XEkyovWPKSkiHJMNZnO8y3N0Cb0lmcjsCcw9IujePC GOUTr5_5w_sqZk6aG1Uf8mxDmMp.AFly4e8KlVHFME6nCAxHBKJamuVUlEzGpx.r5icdvkQJ1KbX _gJA8KwqeqHWUUbJ_KLvJyu67VwI40CIn_cBVt8ZxsEaUkJUzfY_sEHA0XmMDtNo9Kdog_7HkcIr NZxk6fCf7yxfza6Ip8Z3FaJNpIKVhYLDj38BUqYbHG8i9IlIv0bS..t.rVn4GJ33ep7ZOVZ8H_Ba X8o4uRVaKtvm9LafhQzTm37anlz.Ij38FiB84YMBCEpC.xD9CpDosLozhISMfx5gfDmA3rkoEP2L DPUvOJ_V.OtvE0Jn_EvrjyR57pi2nPCj2Hq8giDbNYrQPMc3C158J7mQNAnVz8c1SLNzC.qAxW7l rWng3FFJKgDAq9oiefa_s5oXRa0NyPVNfVoBDunInl X-Sonic-MF: X-Sonic-ID: c5d01afc-6b03-4af1-9a5c-cd76bbff58c6 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Tue, 16 Apr 2024 21:51:26 +0000 Original-Received: by hermes--production-ir2-7b99fc9bb6-dmk2d (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 15d096af254d841005b96440493d9304; Tue, 16 Apr 2024 21:51:23 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.22205 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol 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:283459 Archived-At: On Tue, Apr 16, 2024 at 09:30:20PM +0100, João Távora wrote: >On Tue, Apr 16, 2024 at 5:02 PM Ergus wrote: > >> project-multi--merge-plist is just a hack function to merge the >> eglot-workspace-configuration value without overriding the existing >> sub-values if already set (in case the user sets some sub-values in the >> dir locals then those takes precedence) >> >> Then this restarts eglot >> >> IIUC this is equivalent to call `--compile-commands-dir=build` and at >> the moment is working for me. > >This seems extremely complicated, but happy it works for you. > The core idea is actually very simple: if project.el detects a build-dir with compile-commands.json inside then update eglot-workspace-configuration. The rest is just the api to set directory local vars (extremely complicated indeed, but that's what it is) >If during an eglot session something happens that leads to want to update >the "workspace configuration" for a given session, you can set it and >then call `eglot-signal-didChangeConfiguration` which is part of Eglot's >API. No need to restart. Also note that eglot-workspace-configuration >can be a function, maybe that's useful to you somehow. > This is actually very useful; it is probably the only feature I needed in the eglot side. >> At the moment I assume the outer most only; which is the simpler one to >> setup and implement woth the current project.el support. The main goal I >> have is OOSC, not nested projects. > >OK. I don't know what OOSC is but if it's somehow related to "out of tree >builds" Out Of Sources Compilation >I think these are fine, but builds aren't normally not part of a project: >my >.gitignore files ignores them. > Indeed, but my function in project.el won't. The code I wrote considers some file-names as root hints (i.e CMakeLists.txt) and others as build dirs hints (i.e CMakeCache.txt). My project-find-functions hook searches upwards in the directory trees for a root hint and in the top most root it searches not recursively for the build dir hint in the root's sub-directories. When there are multiple build dirs it asks to the user for which one to use. And after that it searches for the compile-commands.json there. The code also sets a directory-local-var to avoid repeating this search for all the other files in the future; because I use Tramp extensively and such searches may slow. >João