[geany/geany] 83c043: Update mappings in tm_parser.c

Jiří Techet git-noreply at xxxxx
Mon Mar 14 19:22:47 UTC 2022


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Mon, 14 Mar 2022 19:22:47 UTC
Commit:      83c0439cec5616f2fe27e553fdc0d5b2617debe7
             https://github.com/geany/geany/commit/83c0439cec5616f2fe27e553fdc0d5b2617debe7

Log Message:
-----------
Update mappings in tm_parser.c

The new parser generates 2 tags for import statements like

from A import B

For A tag of the 'i' kind is generated, for B, tag of the kind 'x' is
generated. B includes A in its scope and when we omit generation of
'i', imports are printed in the sidebar with the full scope information
like

Imports
    django.views.decorators.csrf.csrf_exempt
    django.views.decorators.csrf.csrf_exempt2
    django.views.decorators.http.require_POST

When we generate 'i' and map it to something (I used tm_tag_externvar_t
like for the imports themselves, there's nothing in the tag types
we have that would be a good semantic candidate here), the result
in the sidebar is

Imports
    django.views.decorators.csrf
        csrf_exempt
        csrf_exempt2
    django.views.decorators.http
        require_POST

which is more readable IMO.


Modified Paths:
--------------
    src/tagmanager/tm_parser.c

Modified: src/tagmanager/tm_parser.c
4 lines changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -136,9 +136,13 @@ static TMParserMapEntry map_PYTHON[] = {
 	{'f', tm_tag_function_t},
 	{'m', tm_tag_method_t},
 	{'v', tm_tag_variable_t},
+	{'I', tm_tag_undef_t},
+	{'i', tm_tag_externvar_t},
     /* defined as externvar to get those excluded as forward type in symbols.c:goto_tag()
      * so we can jump to the real implementation (if known) instead of to the import statement */
 	{'x', tm_tag_externvar_t},
+	{'z', tm_tag_undef_t},
+	{'l', tm_tag_undef_t},
 };
 
 /* different parser than tex.c from universal-ctags */



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list