unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How can I get C# tags to work?
@ 2024-09-04 13:08 Esben Stien
  2024-09-04 14:25 ` Marcus Harnisch
  0 siblings, 1 reply; 9+ messages in thread
From: Esben Stien @ 2024-09-04 13:08 UTC (permalink / raw)
  To: help-gnu-emacs

I'm trying to get C# tags to work and I'm not getting anything to work,
so I have to start from the beginning;)

I have Universal Ctags installed as u-ctags

```
$ u-ctags --version                                                             
Universal Ctags 6.1.0, Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +packcc, +optscript, +pcre2
```

I have C# source files.

Program.cs

```
namespace Common.Services
{
  public class Tester
  {
    public static void Main()
    {
      IBar Bar = new Bar();
      Bar.Hukarz();
    }
  }
}
```

IBar.cs
```
using System;
using System.Collections.Generic;

namespace Common.Services
{
    interface IBar
    {
        public void Hukarz();
    }
}
```

Bar.cs
```
namespace Common.Services
{
  public class Bar : IBar
  {
    public void Hukarz()
    {
        System.Console.WriteLine("ehlo");
    }
  }
}
```

I create the tags file, as such

```
u-ctags -R
```

The tags file looks like this.

```
!_TAG_EXTRA_DESCRIPTION	anonymous	/Include tags for non-named objects like lambda/
!_TAG_EXTRA_DESCRIPTION	fileScope	/Include tags of file scope/
!_TAG_EXTRA_DESCRIPTION	pseudo	/Include pseudo tags/
!_TAG_EXTRA_DESCRIPTION	subparser	/Include tags generated by subparsers/
!_TAG_FIELD_DESCRIPTION	epoch	/the last modified time of the input file (only for F\/file kind tag)/
!_TAG_FIELD_DESCRIPTION	file	/File-restricted scoping/
!_TAG_FIELD_DESCRIPTION	input	/input file/
!_TAG_FIELD_DESCRIPTION	name	/tag name/
!_TAG_FIELD_DESCRIPTION	pattern	/pattern/
!_TAG_FIELD_DESCRIPTION	typeref	/Type and name of a variable or typedef/
!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_DESCRIPTION!C#	E,event	/events/
!_TAG_KIND_DESCRIPTION!C#	c,class	/classes/
!_TAG_KIND_DESCRIPTION!C#	d,macro	/macro definitions/
!_TAG_KIND_DESCRIPTION!C#	e,enumerator	/enumerators (values inside an enumeration)/
!_TAG_KIND_DESCRIPTION!C#	f,field	/fields/
!_TAG_KIND_DESCRIPTION!C#	g,enum	/enumeration names/
!_TAG_KIND_DESCRIPTION!C#	i,interface	/interfaces/
!_TAG_KIND_DESCRIPTION!C#	m,method	/methods/
!_TAG_KIND_DESCRIPTION!C#	n,namespace	/namespaces/
!_TAG_KIND_DESCRIPTION!C#	p,property	/properties/
!_TAG_KIND_DESCRIPTION!C#	s,struct	/structure names/
!_TAG_KIND_DESCRIPTION!C#	t,typedef	/typedefs/
!_TAG_OUTPUT_EXCMD	mixed	/number, pattern, mixed, or combineV2/
!_TAG_OUTPUT_FILESEP	slash	/slash or backslash/
!_TAG_OUTPUT_MODE	u-ctags	/u-ctags or e-ctags/
!_TAG_OUTPUT_VERSION	0.0	/current.age/
!_TAG_PARSER_VERSION!C#	0.0	/current.age/
!_TAG_PATTERN_LENGTH_LIMIT	96	/0 for no limit/
!_TAG_PROC_CWD	/home/b0ef/proj/2024-08-12.debug-csharp-interface-tags/	//
!_TAG_PROGRAM_AUTHOR	Universal Ctags Team	//
!_TAG_PROGRAM_NAME	Universal Ctags	/Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL	https://ctags.io/	/official site/
!_TAG_PROGRAM_VERSION	6.1.0	//
Bar	Bar.cs	/^  public class Bar : IBar$/;"	c	namespace:Common.Services
Common.Services	Bar.cs	/^namespace Common.Services$/;"	n
Common.Services	IBar.cs	/^namespace Common.Services$/;"	n
Common.Services	Program.cs	/^namespace Common.Services$/;"	n
Hukarz	Bar.cs	/^    public void Hukarz()$/;"	m	class:Common.Services.Bar
Hukarz	IBar.cs	/^        public void Hukarz();$/;"	m	interface:Common.Services.IBar
IBar	IBar.cs	/^    interface IBar$/;"	i	namespace:Common.Services
Main	Program.cs	/^    public static void Main()$/;"	m	class:Common.Services.Tester
Tester	Program.cs	/^  public class Tester$/;"	c	namespace:Common.Services

```

If I now convert this to GNU Global, as such
```
gtags --gtagslabel=ctags -f tags
```

, which outputs:

```
Warning: '!_TAG_EXTRA_DESCRIPTIONanonymous        /Include tags for non-named objects like lambda/' not found. ignored.
Warning: '!_TAG_EXTRA_DESCRIPTIONfileScope        /Include tags of file scope/' not found. ignored.
Warning: '!_TAG_EXTRA_DESCRIPTIONpseudo   /Include pseudo tags/' not found. ignored.
Warning: '!_TAG_EXTRA_DESCRIPTIONsubparser        /Include tags generated by subparsers/' not found. ignored.
Warning: '!_TAG_FIELD_DESCRIPTIONepoch    /the last modified time of the input file (only for F\/file kind tag)/' not found. ignored.
Warning: '!_TAG_FIELD_DESCRIPTIONfile     /File-restricted scoping/' not found. ignored.
Warning: '!_TAG_FIELD_DESCRIPTIONinput    /input file/' not found. ignored. 
Warning: '!_TAG_FIELD_DESCRIPTIONname     /tag name/' not found. ignored.   
Warning: '!_TAG_FIELD_DESCRIPTIONpattern  /pattern/' not found. ignored.    
Warning: '!_TAG_FIELD_DESCRIPTIONtyperef  /Type and name of a variable or typedef/' not found. ignored.
Warning: '!_TAG_FILE_FORMAT     2/extended format; --format=1 will not append ;" to lines/' not found. ignored.
Warning: '!_TAG_FILE_SORTED     1/0=unsorted, 1=sorted, 2=foldcase/' not found. ignored.
Warning: '!_TAG_KIND_DESCRIPTION!C#       E,event /events/' not found. ignored.     
Warning: '!_TAG_KIND_DESCRIPTION!C#       c,class /classes/' not found. ignored.    
Warning: '!_TAG_KIND_DESCRIPTION!C#       d,macro /macro definitions/' not found. ignored.
Warning: '!_TAG_KIND_DESCRIPTION!C#       e,enumerator    /enumerators (values inside an enumeration)/' not found. ignored.
Warning: '!_TAG_KIND_DESCRIPTION!C#       f,field /fields/' not found. ignored.     
Warning: '!_TAG_KIND_DESCRIPTION!C#       g,enum  /enumeration names/' not found. ignored.
Warning: '!_TAG_KIND_DESCRIPTION!C#       i,interface     /interfaces/' not found. ignored. 
Warning: '!_TAG_KIND_DESCRIPTION!C#       m,method        /methods/' not found. ignored.    
Warning: '!_TAG_KIND_DESCRIPTION!C#       n,namespace     /namespaces/' not found. ignored. 
Warning: '!_TAG_KIND_DESCRIPTION!C#       p,property      /properties/' not found. ignored. 
Warning: '!_TAG_KIND_DESCRIPTION!C#       s,struct        /structure names/' not found. ignored.
Warning: '!_TAG_KIND_DESCRIPTION!C#       t,typedef       /typedefs/' not found. ignored.   
Warning: '!_TAG_OUTPUT_EXCMD    mixed     /number, pattern, mixed, or combineV2/' not found. ignored.
Warning: '!_TAG_OUTPUT_FILESEP  slash     /slash or backslash/' not found. ignored.
Warning: '!_TAG_OUTPUT_MODE     u-ctags   /u-ctags or e-ctags/' not found. ignored.
Warning: '!_TAG_OUTPUT_VERSION  0.0       /current.age/' not found. ignored.
Warning: '!_TAG_PARSER_VERSION!C#0.0      /current.age/' not found. ignored.
Warning: '!_TAG_PATTERN_LENGTH_LIMIT      96      /0 for no limit/' not found. ignored.
Warning: '!_TAG_PROC_CWD        /home/b0ef/proj/2024-08-12.debug-csharp-interface-tags/     //' not found. ignored.           
Warning: '!_TAG_PROGRAM_AUTHOR  Universal Ctags Team      //' not found. ignored.           
Warning: '!_TAG_PROGRAM_NAME    Universal Ctags   /Derived from Exuberant Ctags/' not found. ignored.
Warning: '!_TAG_PROGRAM_URL     https://ctags.io/ /official site/' not found. ignored.
Warning: '!_TAG_PROGRAM_VERSION 6.1.0     //' not found. ignored. 
Warning: 'Bar   Bar.cs  /^  public class Bar : IBar$/;"   c       namespace:Common.Services' not found. ignored.
Warning: 'Common.Services       Bar.cs    /^namespace Common.Services$/;"   n' not found. ignored.
Warning: 'Common.Services       IBar.cs   /^namespace Common.Services$/;"   n' not found. ignored.
Warning: 'Common.Services       Program.cs        /^namespace Common.Services$/;"   n' not found. ignored.            
Warning: 'Hukarz        Bar.cs  /^    public void Hukarz()$/;"    mclass:Common.Services.Bar' not found. ignored.
Warning: 'Hukarz        IBar.cs /^        public void Hukarz();$/;"m
interface:Common.Services.IBar' not found. ignored.
Warning: 'IBar  IBar.cs /^    interface IBar$/;"  i       namespace:Common.Services' not found. ignored.
Warning: 'Main  Program.cs      /^    public static void Main()$/;"m
class:Common.Services.Tester' not found. ignored.
Warning: 'Tester        Program.cs
/^  public class Tester$/;"     cnamespace:Common.Services' not found. ignored.

```

The resulting three G* files don't contain any symbols.

Any pointers as to what's happening here?;)

-- 
Esben Stien is b0ef@e     s      a
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e
           jid:b0ef@    n     n



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

end of thread, other threads:[~2024-09-09 15:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 13:08 How can I get C# tags to work? Esben Stien
2024-09-04 14:25 ` Marcus Harnisch
2024-09-05  8:54   ` Esben Stien
2024-09-05  9:03     ` Marcus Harnisch
2024-09-05 11:37       ` Esben Stien
2024-09-05 12:39         ` Marcus Harnisch
2024-09-06 12:11           ` Esben Stien
2024-09-09  7:51             ` Esben Stien
2024-09-09 15:25             ` Marcus Harnisch

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