* 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
* Re: How can I get C# tags to work?
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
0 siblings, 1 reply; 9+ messages in thread
From: Marcus Harnisch @ 2024-09-04 14:25 UTC (permalink / raw)
To: help-gnu-emacs
Hi Esben
On 04/09/2024 15.08, Esben Stien wrote:
> I have Universal Ctags installed as u-ctags
Its default file format differs from classic ctags.
> gtags --gtagslabel=ctags -f tags
Try `gtags --gtagslabel=universal-ctags -f tags`, and see if that fixes it.
--
Marcus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How can I get C# tags to work?
2024-09-04 14:25 ` Marcus Harnisch
@ 2024-09-05 8:54 ` Esben Stien
2024-09-05 9:03 ` Marcus Harnisch
0 siblings, 1 reply; 9+ messages in thread
From: Esben Stien @ 2024-09-05 8:54 UTC (permalink / raw)
To: Marcus Harnisch; +Cc: help-gnu-emacs
Marcus Harnisch <mh-gmane@online.de> writes:
> Try `gtags --gtagslabel=universal-ctags -f tags`, and see if that fixes it.
It ate the warnings, but the files are empty;)
$ cat GPATH GRTAGS GTAGS |strings
__.NEXTKEY │
./IBar.cs │
./IBar.cs │
./Bar.cs │
./Bar.cs │
./Program.cs │
./Program.cs │
__.VERSION │
__.VERSION 2 │
__.VERSION │
__.VERSION 6 │
__.COMPNAME │
__.COMPNAME │
__.COMPLINE │
__.COMPLINE │
__.COMPACT │
__.COMPACT │
__.VERSION │
__.VERSION 6 │
__.COMPRESS │
__.COMPRESS ddefine ttypedef │
__.COMPNAME │
__.COMPNAME
--
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
* Re: How can I get C# tags to work?
2024-09-05 8:54 ` Esben Stien
@ 2024-09-05 9:03 ` Marcus Harnisch
2024-09-05 11:37 ` Esben Stien
0 siblings, 1 reply; 9+ messages in thread
From: Marcus Harnisch @ 2024-09-05 9:03 UTC (permalink / raw)
To: help-gnu-emacs
On 05/09/2024 10.54, Esben Stien wrote:
>> Try `gtags --gtagslabel=universal-ctags -f tags`, and see if that fixes it.
>
> It ate the warnings, but the files are empty;)
What does `gtags --explain ...` print?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How can I get C# tags to work?
2024-09-05 9:03 ` Marcus Harnisch
@ 2024-09-05 11:37 ` Esben Stien
2024-09-05 12:39 ` Marcus Harnisch
0 siblings, 1 reply; 9+ messages in thread
From: Esben Stien @ 2024-09-05 11:37 UTC (permalink / raw)
To: Marcus Harnisch; +Cc: help-gnu-emacs
Marcus Harnisch <mh-gmane@online.de> writes:
> What does `gtags --explain ...` print?
$ gtags --explain
- File '.projectile' is skipped because the name begins with a dot. │
- File 'GTAGS' is skipped because it is a tag file. │
- File 'GRTAGS' is skipped because it is a tag file. │
- File 'tags' is skipped by the skip list. │
- File '.obtt' is skipped because the name begins with a dot. │
- File 'GPATH' is skipped because it is a tag file. │
--
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
* Re: How can I get C# tags to work?
2024-09-05 11:37 ` Esben Stien
@ 2024-09-05 12:39 ` Marcus Harnisch
2024-09-06 12:11 ` Esben Stien
0 siblings, 1 reply; 9+ messages in thread
From: Marcus Harnisch @ 2024-09-05 12:39 UTC (permalink / raw)
To: help-gnu-emacs
On 05/09/2024 13.37, Esben Stien wrote:
> Marcus Harnisch <mh-gmane@online.de> writes:
>
>> What does `gtags --explain ...` print?
>
> $ gtags --explain
> - File '.projectile' is skipped because the name begins with a dot. │
> - File 'GTAGS' is skipped because it is a tag file. │
> - File 'GRTAGS' is skipped because it is a tag file. │
> - File 'tags' is skipped by the skip list. │
> - File '.obtt' is skipped because the name begins with a dot. │
> - File 'GPATH' is skipped because it is a tag file. │
OK, and `gtags -v --explain ...`?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How can I get C# tags to work?
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
0 siblings, 2 replies; 9+ messages in thread
From: Esben Stien @ 2024-09-06 12:11 UTC (permalink / raw)
To: Marcus Harnisch; +Cc: help-gnu-emacs
Marcus Harnisch <mh-gmane@online.de> writes:
> [..] gtags -v --explain [..]
$ gtags -v --explain
[Fri Sep 06 14:10:10 CEST 2024] Gtags started. │
Using default configuration. │
[Fri Sep 06 14:10:10 CEST 2024] Creating 'GTAGS' and 'GRTAGS'. │
- File '.projectile' is skipped because the name begins with a dot. │
- File 'GTAGS' is skipped because it is a tag file. │
- File 'GRTAGS' is skipped because it is a tag file. │
- File 'tags' is skipped by the skip list. │
- File '.obtt' is skipped because the name begins with a dot. │
- File 'GPATH' is skipped because it is a tag file. │
[Fri Sep 06 14:10:10 CEST 2024] Done.
--
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
* Re: How can I get C# tags to work?
2024-09-06 12:11 ` Esben Stien
@ 2024-09-09 7:51 ` Esben Stien
2024-09-09 15:25 ` Marcus Harnisch
1 sibling, 0 replies; 9+ messages in thread
From: Esben Stien @ 2024-09-09 7:51 UTC (permalink / raw)
To: Marcus Harnisch; +Cc: help-gnu-emacs
Esben Stien <b0ef@esben-stien.name> writes:
> Marcus Harnisch <mh-gmane@online.de> writes:
>> [..] gtags -v --explain [..]
This gave you any clues?;)
--
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
* Re: How can I get C# tags to work?
2024-09-06 12:11 ` Esben Stien
2024-09-09 7:51 ` Esben Stien
@ 2024-09-09 15:25 ` Marcus Harnisch
1 sibling, 0 replies; 9+ messages in thread
From: Marcus Harnisch @ 2024-09-09 15:25 UTC (permalink / raw)
To: help-gnu-emacs
On 06/09/2024 14.11, Esben Stien wrote:
> Marcus Harnisch <mh-gmane@online.de> writes:
>
>> [..] gtags -v --explain [..]
>
> $ gtags -v --explain
> [Fri Sep 06 14:10:10 CEST 2024] Gtags started. │
> Using default configuration. │
> [Fri Sep 06 14:10:10 CEST 2024] Creating 'GTAGS' and 'GRTAGS'. │
> - File '.projectile' is skipped because the name begins with a dot. │
> - File 'GTAGS' is skipped because it is a tag file. │
> - File 'GRTAGS' is skipped because it is a tag file. │
> - File 'tags' is skipped by the skip list. │
> - File '.obtt' is skipped because the name begins with a dot. │
> - File 'GPATH' is skipped because it is a tag file. │
> [Fri Sep 06 14:10:10 CEST 2024] Done.
It doesn't seem to scan anything. Are you sure GPATH has the correct
list of files? The log message above doesn't contain messages along the
lines of:
[1] extracting tags of ./Bar.cs
[2] extracting tags of ./IBar.cs
...
Your had specified a file list (`-f tags`). What does that look like?
^ 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
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.