This patch allows us to map roles reported by ctags to different tag manager types. For instance, for the Go parser both packages and imports are reported by the kind letter 'p' and are distinguished only by the "imported" role.
(Code doing this for Go is commented-out for now because we need some more improvements of the symbol tree because all root categories are occupied and there's no place where to put the imports now.) You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3102
-- Commit Summary --
* Allow mapping ctags "roles" to arbitrary tag manager type
-- File Changes --
M src/tagmanager/tm_ctags.c (25) M src/tagmanager/tm_parser.c (18) M src/tagmanager/tm_parser.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/3102.patch https://github.com/geany/geany/pull/3102.diff
Hmmmm, must try C++ modules (after I work out how to use them :-)
Hmmmm, must try C++ modules (after I work out how to use them :-)
Are those parsed at all by the cxx parser? The Go example I mentioned was specific to tags/roles reported by the given parser and each parser uses roles for something different.
Are those parsed at all by the cxx parser?
Well, that was the question, but FIF says no "module" or "import" in directory `ctags/parsers/cxx` :-(
Yeah, I thought so.
Roles are currently used for this stuff: ``` parallels@debian-gnu-linux-10:~/projects/ctags$ ctags --list-roles #LANGUAGE KIND(L/N) NAME ENABLED DESCRIPTION Ada p/package subunit on package name referenced in separate() Ant i/antfile imported on imported Asm s/section placement on placement where the assembled code goes AutoIt S/script local on local include AutoIt S/script system on system include Autoconf e/optenable cmdline on specified in a configure command line Autoconf w/optwith cmdline on specified in a configure command line Automake c/condition branched on used for branching Automake d/directory data on directory for DATA primary Automake d/directory library on directory for LIBRARIES primary Automake d/directory ltlibrary on directory for LTLIBRARIES primary Automake d/directory man on directory for MANS primary Automake d/directory program on directory for PROGRAMS primary Automake d/directory script on directory for SCRIPTS primary C d/macro condition off used in part of #if/#ifdef/#elif conditions C d/macro undef on undefined C h/header local on local header C h/header system on system header C++ d/macro condition off used in part of #if/#ifdef/#elif conditions C++ d/macro undef on undefined C++ h/header local on local header C++ h/header system on system header CPreProcessor d/macro condition off used in part of #if/#ifdef/#elif conditions CPreProcessor d/macro undef on undefined CPreProcessor h/header local on local header CPreProcessor h/header system on system header CUDA d/macro condition off used in part of #if/#ifdef/#elif conditions CUDA d/macro undef on undefined CUDA h/header local on local header CUDA h/header system on system header Cobol S/sourcefile copied on copied in source file CobolFree S/sourcefile copied on copied in source file CobolVariable S/sourcefile copied on copied in source file DTD e/element attOwner on attributes owner DTD p/parameterEntity condition on conditions DTD p/parameterEntity elementName on element names DTD p/parameterEntity partOfAttDef on part of attribute definition Elm m/module imported on imported module Flex I/import import on imports GDScript c/class extended on used as a base class for extending GemSpec g/gem develDep on specifying development dependency GemSpec g/gem runtimeDep on specifying runtime dependency Glade c/class widget on specified as a widget constructor Glade h/handler handler on specified as a callback for signal emission Go p/package imported on imported package Go u/unknown receiverType on receiver type HTML C/stylesheet extFile on referenced as external files HTML J/script extFile on referenced as external files HTML c/class attribute on assigned as attributes Java p/package imported on imported package Julia n/module imported on loaded by "import" Julia n/module namespace on only some symbols in it are imported Julia n/module used on loaded by "using" Julia x/unknown imported on loaded by "import" Julia x/unknown used on loaded by "using" Kconfig k/kconfig source on kconfig file loaded with source directive LdScript i/inputSection discarded on discarded when linking LdScript i/inputSection mapped on mapped to output section LdScript s/symbol entrypoint on entry points Lua X/unknown referenced off referenced somehow M4 I/macrofile included on included macro M4 I/macrofile sincluded on silently included macro M4 d/macro undef on undefined Make I/makefile included on included Make I/makefile optional on optionally included Maven2 a/artifactId dependency on dependency Maven2 a/artifactId parent on parent Maven2 g/groupId dependency on dependency Maven2 g/groupId parent on parent NSIS i/script included on included with !include OldC d/macro condition off used in part of #if/#ifdef/#elif conditions OldC d/macro undef on undefined OldC h/header local on local header OldC h/header system on system header OldC++ d/macro condition off used in part of #if/#ifdef/#elif conditions OldC++ d/macro undef on undefined OldC++ h/header local on local header OldC++ h/header system on system header Perl M/module unused on specified in `no' built-in function Perl M/module used on specified in `use' built-in function Perl h/heredoc endmarker on end marker Protobuf D/protodef imported on imported Protobuf m/message extension on extending the message Python i/module imported on imported modules Python i/module indirectlyImported on module imported in alternative name Python i/module namespace on namespace from where classes/variables/functions are imported Python x/unknown imported on imported from the other module Python x/unknown indirectlyImported on classes/variables/functions/modules imported in alternative name R l/library library on library attached by library function R l/library require on library attached by require function R s/source source on source loaded by source fucntion RpmSpec m/macro undef on undefined RpmSpec p/patch decl on declared for applying later Ruby L/library loaded on loaded by "load" method Ruby L/library required on loaded by "require" method Ruby L/library requiredRel on loaded by "require_relative" method Sh h/heredoc endmarker on end marker Sh s/script loaded on loaded SystemdUnit u/unit After on referred in After key SystemdUnit u/unit Before on referred in Before key SystemdUnit u/unit RequiredBy on referred in RequiredBy key SystemdUnit u/unit Requires on referred in Requires key SystemdUnit u/unit WantedBy on referred in WantedBy key SystemdUnit u/unit Wants on referred in Wants key Tex i/xinput bibliography on bibliography (.bib) file Tex i/xinput included on external input file specified with \include Tex i/xinput input on external input file specified with \input Thrift T/thriftFile included on included file VHDL e/entity desigend on designed by an architecture Vera d/macro condition off used in part of #if/#ifdef/#elif conditions Vera d/macro undef on undefined Vera h/header local on local header Vera h/header system on system header XSLT m/matchedTemplate applied on applied XSLT n/namedTemplate called on called XSLT p/parameter bound on bound to value XSLT s/stylesheet imported on imported XSLT s/stylesheet included on included ```
Well, C++ is using roles for header stuff, so I would have thought it likely it will do so for modules if its can't add extra kinds?? Anyway lets wait until "somebody" makes ctags at least parser them.
github-comments@lists.geany.org