From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78433 invoked by alias); 11 Sep 2019 10:05:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 78419 invoked by uid 89); 11 Sep 2019 10:05:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=Universal X-HELO: mail-io1-f66.google.com Received: from mail-io1-f66.google.com (HELO mail-io1-f66.google.com) (209.85.166.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Sep 2019 10:05:05 +0000 Received: by mail-io1-f66.google.com with SMTP id j4so44452861iog.11 for ; Wed, 11 Sep 2019 03:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=elIu5XhuAVAHv6Py6UWXzW0B78UDKGmXQb1y2gtNEVU=; b=T2trirF3+PA46hN7PInBN4+2oQYqNHT9UzJduw7+CDspsXk3ta1aXjIYM462uQblUK AeO4VzgilamBYeVUZydGdBaQrI9MP6dXeiN1IMzc9qGcT3ehQCSOc9bjdIp5avRDPwo/ Y8gkCxGJVgPKanS29Hp1bi0rmlL7d5mboeC+PJI+5sISGFzlj9O+6pR3RxcS/YPa3p44 cZPh61QcYJ0fNguUAQYl5sVH0ln4BiHaVwUKqqv9SwznqX/xLKyd7MiMdJOBl2aNie8Q gq/Rr1DrlSglDti3kIpTOj4DWGm8ydLe/4ZGLNwpQAUA0xUCOJ0ST5qp0epWz5u+0AiI AWxw== MIME-Version: 1.0 References: <382dec9f-4a34-20f4-e0cd-ef57debeaa0f@gmail.com> In-Reply-To: From: Hi-Angel Date: Wed, 11 Sep 2019 10:05:00 -0000 Message-ID: Subject: Re: Enabling Ctags Tree Wide for GCC To: Nicholas Krause Cc: Andreas Schwab , GCC Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00078.txt.bz2 On Wed, 11 Sep 2019 at 12:50, Hi-Angel wrote: > > On Wed, 11 Sep 2019 at 09:55, Nicholas Krause wrote: > > > > > > On 9/11/19 2:30 AM, Andreas Schwab wrote: > > > On Sep 11 2019, Nicholas Krause wrote: > > > > > >> I was wondering what is the easiest way to allow source tree wide > > >> ctags. > > > There is make TAGS, which uses etags. > > Note: over time on the internet appeared quite a few different "ctags" > projects (exuberant ctags universal ctags, anjuta-ctags, you named > it), AFAIK the currently maintained and developed project with the > most number of supported languages is universal ctags, so I recommend > using it. > > > Is there no way to build it for vim as thats what I would prefer to stay > > with. > > (disclaimer: I'm just a random reader of the ML) > > Using ctags with any project is as simple as `ctags -R` in base > directory of sources (add -e option if you use Emacs). > > There's no need for any complex setup, because the "tags" format is > very dumb. It's just "tag name" (e.g. name of a function, struct, > macro), line number, and the whole line where that name is defined. > So, in particular, if you have 2 functions foo() defined, and you jump > to a tag "foo()", there's no way a text editor can figure out which > one "foo()" is that you wanted, so it would either jump to the first > occurrence (vim does that, you need to use :tn :tp to navigate > further) or present you with a list of occurences (Emacs does this). > > So, I doubt there's a "make tags" command, because it's one symbol > bigger than "ctags -R" ;-) Worth noting btw, that ctags are a great thing if you want to quickly dive in to a project, and you're okay with their downsides, such as not being able to resolve foo() as in example. This even especially emphasized by the fact my local Universal Ctags support 100 (!!!) languages (`ctags --list-languages | wc -l`) But in the long run, if you work with a project a lot, I'd recommend looking at setting up an LSP server. All modern editors support it, including vim and emacs (some natively, some through extensions). It doesn't have the downsides of tags format, and can also provide you with things like completion or error highlighting as you type.