[geany/geany] 3d9908: Set tag kind for Python imports to externvar and map them in the symbol list.

Enrico Tröger git-noreply at xxxxx
Sat Feb 8 09:26:08 UTC 2014


Branch:      refs/heads/master
Author:      Enrico Tröger <enrico.troeger at uvena.de>
Committer:   Enrico Tröger <enrico.troeger at uvena.de>
Date:        Sat, 08 Feb 2014 09:26:08 UTC
Commit:      3d9908df8cf63c857d2f38b6653df018acb67ba8
             https://github.com/geany/geany/commit/3d9908df8cf63c857d2f38b6653df018acb67ba8

Log Message:
-----------
Set tag kind for Python imports to externvar and map them in the symbol list.

This fixes 'Go to Tag definition' for parsed Python imports as before the import
statement was chosen as the definition while we prefer the class definition as
target.


Modified Paths:
--------------
    src/symbols.c
    tagmanager/ctags/python.c

Modified: src/symbols.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -887,7 +887,7 @@ static void add_top_level_items(GeanyDocument *doc)
 				&(tv_iters.tag_member), _("Methods"), "classviewer-macro",
 				&(tv_iters.tag_function), _("Functions"), "classviewer-method",
 				&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
-				&(tv_iters.tag_namespace), _("Imports"), "classviewer-namespace",
+				&(tv_iters.tag_externvar), _("Imports"), "classviewer-namespace",
 				NULL);
 			break;
 		}


Modified: tagmanager/ctags/python.c
4 files changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -33,7 +33,9 @@
 	{TRUE, 'f', "function", "functions"},
 	{TRUE, 'm', "method",   "class methods"},
     {TRUE, 'v', "variable", "variables"},
-    {TRUE, 'i', "namespace", "imports"}
+    /* 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 */
+    {TRUE, 'x', "externvar", "imports"}
 };
 
 typedef enum {



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