From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#70408: 30.0.50; Eglot and Project integration Date: Sat, 20 Apr 2024 14:10:53 +0100 Message-ID: References: <87o7aas3sk.fsf.ref@aol.com> <87o7aas3sk.fsf@aol.com> <86le5djzz2.fsf@gnu.org> <8cfba95b-fedd-4b5f-9778-d656601006d1@gutov.dev> <51785013-d847-4a1d-a5df-3b25dcf1084c@gutov.dev> 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="26580"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 70408@debbugs.gnu.org, Ergus To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 20 15:13:27 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 1ryAX1-0006mD-MW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Apr 2024 15:13:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryAWS-0003oH-Mn; Sat, 20 Apr 2024 09:12:52 -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 1ryAWQ-0003nN-It for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 09:12: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 1ryAWQ-0004Dy-4W for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 09:12:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryAWe-0004Qj-O6 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 09:13:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Apr 2024 13:13:04 +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.171361874216515 (code B ref 70408); Sat, 20 Apr 2024 13:13:04 +0000 Original-Received: (at 70408) by debbugs.gnu.org; 20 Apr 2024 13:12:22 +0000 Original-Received: from localhost ([127.0.0.1]:36271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryAVm-0004Gg-JM for submit@debbugs.gnu.org; Sat, 20 Apr 2024 09:12:21 -0400 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:58384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryAV4-0003zT-Ci for 70408@debbugs.gnu.org; Sat, 20 Apr 2024 09:11:57 -0400 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-518b9527c60so3336319e87.0 for <70408@debbugs.gnu.org>; Sat, 20 Apr 2024 06:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713618665; x=1714223465; darn=debbugs.gnu.org; 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=Vz7U8HN0nhEB/2BdK1cOT8dzJpxqiqpbnKj3H1I785w=; b=P3gejXO+JwTyF70Fxu0+l+lqdEk9Kty55CDgWx8VTsuC9XVABV84H7dlWryObY9zsz 56Ih1ygg05qZLMfLC5eQxeEJyRKbHAidDLcFz+Q2oDw0kawDdoKALdlp4NBDbQQkEhgB Vz/bHCCCHvVX3cZ75tI7T8PJKmXaTtvsqoRr9mLBCX1murUyyqd9Gp0+p82kPQn7Kbn3 cyCY46bwlUbUxq7gqRaviqvrUQTfEyUTtCbHoqITij837htKJrWbrGSnHFW2VTZ6UPKj ntDvAoITc7FqgVkUduTTQjYJMOtPZitzcMmnrY+O1D1JieReTUFxqFtdQr9Or8kpXEVu op+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713618665; x=1714223465; 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=Vz7U8HN0nhEB/2BdK1cOT8dzJpxqiqpbnKj3H1I785w=; b=cEBdTgoK7kQp8JH4bCnECzCJ0lO/tQTC2rYpyNmB68pWGUovtfgBU8ajFT9lN47XrL YJBuPun1yMmzUBpXzcOWB+t9m4m0m9HOOwBKV08TVQYNty8d0Et/iTitx7tVWaxBKZ5a OwqWensyjW4IyP0RuFluaP0xDVP+4UMsLwibIi0SHdDYu7zDaxJr2SBpjAezF7Ga83rf dJmovXmy0z6/2zHAtUI0elvkwLxkRpkMjiE/C+vne6O7+0ZPKzBJj4ViwYrqxjHNrb/M u2/hXn2NF0vV13QkKUW8oikYA2GbdpqDgJvk4/FK896E76augE3i/Z4PeqmVE2KcB27f ED6g== X-Forwarded-Encrypted: i=1; AJvYcCXzZiKlKfbaYzIPAuq4VbfawXT9xKv3yH7N5qWgHM0ToaQ7OkAznZeT9bmAlGHwJlaUmEqFDrm3uufgLrGyNeZyqGttaek= X-Gm-Message-State: AOJu0YyXzjeHv4MWCvAbWsc4ii66680msZ2tJT9kltONer7FtGIEiAJm PcSM9i0vxNa3KRXhDMtUYPqffzjr19meD4Ds9thhgYpExtPXZE7cSxnUnderwIaCGjiVpc3JMTt 6bisvQQ01U5UoQFsrbFI8dlPypmo= X-Google-Smtp-Source: AGHT+IGpQmfRQTfQ6HsBbi/mb3rXLgTQEQz7JBJjH2DOKohMYGbQT0J9/2qRlCgYtPeXFYjyWbi3EbVFLnzVQX5Fbwk= X-Received: by 2002:a19:5f49:0:b0:513:cf5e:f2ad with SMTP id a9-20020a195f49000000b00513cf5ef2admr3664082lfj.60.1713618664805; Sat, 20 Apr 2024 06:11:04 -0700 (PDT) In-Reply-To: <51785013-d847-4a1d-a5df-3b25dcf1084c@gutov.dev> 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:283735 Archived-At: On Sat, Apr 20, 2024 at 12:28=E2=80=AFPM Dmitry Gutov wr= ote: > > Because of this, C++ projects usually have sth like: > > > > ln -sf build/compile_commands.json compile_commands.json > > > > as a build step. > > Would you say it's common across most projects? E.g. generated as a > build step by CMake in out-of-tree comfigurations. > Or is it something Emacs users tend to add. Pretty common, yes. I googled for the ln string: https://pspdfkit.com/blog/2019/visual-studio-code-for-cpp/ VSCode https://blog.justforlxz.com/2020/12/23/ccls/ Nvim, I think https://stackoverflow.com/questions/62461375/clang-using-cmake-to-build-a-c= ompile-commands-json-for-my-project https://www.reddit.com/r/cmake/comments/u0ztoq/compile_commandsjson_from_cm= akelist/ https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html Then there is this youtube video I happened to catch recently. https://www.youtube.com/watch?v=3DnRpvWgymOuc&t=3D2467s 7:30 But I guess you can make major modes (or user code) or minor-modes set eglot-server-programs or add methods to eglot-initialization-options in clever ways to automatically point clangd to a given compile-commands.json. And quite likely you can convince CMake to create it in other places too. But I've never needed to, the 'ln' solution is too good. You can even commit the symlink. > What I'm wondering is whether we might be currently disadvantaged > compared to the users of some other editors, which might have some more > auto-detection in that area. Dunno. At $DAYJOB there are people struggling in VSCode extension mayhem with faulty static analysis because they have no idea that the compile_commands.json is a config-time artifact, maybe the plugin tries to hide that from them? But I wouldn't be surprised if lsp-mode features this in its c++-specific file. Haven't checked. My policy has always been to keep language-specific cruft like this out of Eglot, make the common case easy and allow the fancy case to be coded in .emacs, in major-mode or libraries. > I'm open to continuing this discussion somewhere Don't bother :-) I've given all my feedback on that matter, don't have time, am happy with my .emacs hacks and so are those Eglot users.