From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id D426A1F66E for ; Tue, 1 Sep 2020 07:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbgIAHi2 (ORCPT ); Tue, 1 Sep 2020 03:38:28 -0400 Received: from cloud.peff.net ([104.130.231.41]:45976 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgIAHi2 (ORCPT ); Tue, 1 Sep 2020 03:38:28 -0400 Received: (qmail 24564 invoked by uid 109); 1 Sep 2020 07:38:28 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 01 Sep 2020 07:38:28 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 24139 invoked by uid 111); 1 Sep 2020 07:38:27 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 01 Sep 2020 03:38:27 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 1 Sep 2020 03:38:27 -0400 From: Jeff King To: Junio C Hamano Cc: "brian m. carlson" , Philippe Blain via GitGitGadget , git@vger.kernel.org, Philippe Blain Subject: Re: [PATCH] Makefile: add support for generating JSON compilation database Message-ID: <20200901073827.GA3967005@coredump.intra.peff.net> References: <20200830221004.GB241078@camp.crustytoothpaste.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sun, Aug 30, 2020 at 09:24:03PM -0700, Junio C Hamano wrote: > "brian m. carlson" writes: > > > On 2020-08-30 at 19:28:27, Philippe Blain via GitGitGadget wrote: > >> From: Philippe Blain > >> > >> Tools based on LibClang [1] can make use of a 'JSON Compilation > >> Database' [2] that keeps track of the exact options used to compile a set > >> of source files. > > > > For additional context why this is valuable, clangd, which is a C > > language server protocol implementation, can use these files to > > determine the flags needed to compile a file so it can provide proper > > editor integration. As a result, editors supporting the language server > > protocol (such as VS Code, or Vim with a suitable plugin) can provide > > better searching, integration, and refactoring tools. > > I found that the proposed commit log was very weak to sell the > change; some of what you gave above should definitely help strenthen > it. Likewise. Looking at the output, I'm confused how it would help with things like searching and refactoring. It might be nice to spell it out for those of us exposed to it for the first time (I tried following the links but remained unenlightened). I'd also be curious to hear what advantages it gives to add a new Makefile knob rather than just letting interested parties add -MJ to their CFLAGS. Is it just a convenience to create the concatenated form? It seems weird that projects would need to do so themselves with sed hackery (i.e., I'd expect whatever consumes this json to be able to handle multiple files). -Peff