public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hi-Angel <hiangel999@gmail.com>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: Andreas Schwab <schwab@suse.de>, GCC <gcc@gcc.gnu.org>
Subject: Re: Enabling Ctags Tree Wide for GCC
Date: Wed, 11 Sep 2019 10:05:00 -0000	[thread overview]
Message-ID: <CAHGDjgC7UODu=xhs+Ch+AhERgo_s_gU6Jtpd18SmRk66cZ_9nw@mail.gmail.com> (raw)
In-Reply-To: <CAHGDjgBp=isgTqwsiAEtH+ji3XnuM2gumwBg+yQN0owVVPAAWg@mail.gmail.com>

On Wed, 11 Sep 2019 at 12:50, Hi-Angel <hiangel999@gmail.com> wrote:
>
> On Wed, 11 Sep 2019 at 09:55, Nicholas Krause <xerofoify@gmail.com> wrote:
> >
> >
> > On 9/11/19 2:30 AM, Andreas Schwab wrote:
> > > On Sep 11 2019, Nicholas Krause <xerofoify@gmail.com> 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.

  reply	other threads:[~2019-09-11 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  5:02 Nicholas Krause
2019-09-11  6:31 ` Andreas Schwab
2019-09-11  6:55   ` Nicholas Krause
2019-09-11  9:50     ` Hi-Angel
2019-09-11 10:05       ` Hi-Angel [this message]
2019-09-11 11:57 ` Martin Liška
2019-09-11 15:51 ` Eric Gallager

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHGDjgC7UODu=xhs+Ch+AhERgo_s_gU6Jtpd18SmRk66cZ_9nw@mail.gmail.com' \
    --to=hiangel999@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=schwab@suse.de \
    --cc=xerofoify@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).