public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Enabling Ctags Tree Wide for GCC
@ 2019-09-11  5:02 Nicholas Krause
  2019-09-11  6:31 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nicholas Krause @ 2019-09-11  5:02 UTC (permalink / raw)
  To: gcc

Greetings,

I was wondering what is the easiest way to allow source tree wide ctags. 
There doesn't

seem to be a make x command for it nor any real documentation online and 
it would

be nice to have.


Thanks,

Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Enabling Ctags Tree Wide for GCC
  2019-09-11  5:02 Enabling Ctags Tree Wide for GCC Nicholas Krause
@ 2019-09-11  6:31 ` Andreas Schwab
  2019-09-11  6:55   ` Nicholas Krause
  2019-09-11 11:57 ` Martin Liška
  2019-09-11 15:51 ` Eric Gallager
  2 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2019-09-11  6:31 UTC (permalink / raw)
  To: Nicholas Krause; +Cc: gcc

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.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Enabling Ctags Tree Wide for GCC
  2019-09-11  6:31 ` Andreas Schwab
@ 2019-09-11  6:55   ` Nicholas Krause
  2019-09-11  9:50     ` Hi-Angel
  0 siblings, 1 reply; 7+ messages in thread
From: Nicholas Krause @ 2019-09-11  6:55 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc


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.
>
> Andreas.
>
Andreas,


Is there no way to build it for vim as thats what I would prefer to stay 
with.


Anyhow thanks,


Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Enabling Ctags Tree Wide for GCC
  2019-09-11  6:55   ` Nicholas Krause
@ 2019-09-11  9:50     ` Hi-Angel
  2019-09-11 10:05       ` Hi-Angel
  0 siblings, 1 reply; 7+ messages in thread
From: Hi-Angel @ 2019-09-11  9:50 UTC (permalink / raw)
  To: Nicholas Krause; +Cc: Andreas Schwab, GCC

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" ;-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Enabling Ctags Tree Wide for GCC
  2019-09-11  9:50     ` Hi-Angel
@ 2019-09-11 10:05       ` Hi-Angel
  0 siblings, 0 replies; 7+ messages in thread
From: Hi-Angel @ 2019-09-11 10:05 UTC (permalink / raw)
  To: Nicholas Krause; +Cc: Andreas Schwab, GCC

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Enabling Ctags Tree Wide for GCC
  2019-09-11  5:02 Enabling Ctags Tree Wide for GCC Nicholas Krause
  2019-09-11  6:31 ` Andreas Schwab
@ 2019-09-11 11:57 ` Martin Liška
  2019-09-11 15:51 ` Eric Gallager
  2 siblings, 0 replies; 7+ messages in thread
From: Martin Liška @ 2019-09-11 11:57 UTC (permalink / raw)
  To: Nicholas Krause, gcc

On 9/11/19 7:02 AM, Nicholas Krause wrote:
> Greetings,
> 
> I was wondering what is the easiest way to allow source tree wide ctags. There doesn't
> 
> seem to be a make x command for it nor any real documentation online and it would
> 
> be nice to have.
> 
> 
> Thanks,
> 
> Nick
> 

Hi.

Please do not use ctags. It has very poor coverage for any C++ codebase.
I prefer to use clangd (with -background-index) instead with vim-lsp
(Language Server Protocol for VIM).

https://clang.llvm.org/extra/clangd/Installation.html

Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Enabling Ctags Tree Wide for GCC
  2019-09-11  5:02 Enabling Ctags Tree Wide for GCC Nicholas Krause
  2019-09-11  6:31 ` Andreas Schwab
  2019-09-11 11:57 ` Martin Liška
@ 2019-09-11 15:51 ` Eric Gallager
  2 siblings, 0 replies; 7+ messages in thread
From: Eric Gallager @ 2019-09-11 15:51 UTC (permalink / raw)
  To: Nicholas Krause; +Cc: gcc

On 9/11/19, Nicholas Krause <xerofoify@gmail.com> wrote:
> Greetings,
>
> I was wondering what is the easiest way to allow source tree wide ctags.
> There doesn't
>
> seem to be a make x command for it nor any real documentation online and
> it would
>
> be nice to have.
>

ISTR this topic coming up 2 years ago:
https://gcc.gnu.org/ml/gcc/2017-09/msg00266.html

>
> Thanks,
>
> Nick
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-09-11 15:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  5:02 Enabling Ctags Tree Wide for GCC 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
2019-09-11 11:57 ` Martin Liška
2019-09-11 15:51 ` Eric Gallager

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).