help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I get C# tags to work?


From: Esben Stien
Subject: How can I get C# tags to work?
Date: Wed, 04 Sep 2024 15:08:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]