[gnome-builder] ctags: parse "import" lines as seen from parsing Python files



commit 246ec522083446f051d6ea8f5afd074f5931c715
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jan 28 14:41:03 2018 -0800

    ctags: parse "import" lines as seen from parsing Python files
    
    This ensures we load the package imports from python files, which have the
    'i' type (not found in various ctags definitions used to originally
    implement this plugin).
    
    Fixes #250

 src/plugins/ctags/ide-ctags-index.c | 1 +
 src/plugins/ctags/ide-ctags-index.h | 4 ++++
 2 files changed, 5 insertions(+)
---
diff --git a/src/plugins/ctags/ide-ctags-index.c b/src/plugins/ctags/ide-ctags-index.c
index 23edac77a..098e540bd 100644
--- a/src/plugins/ctags/ide-ctags-index.c
+++ b/src/plugins/ctags/ide-ctags-index.c
@@ -161,6 +161,7 @@ ide_ctags_index_parse_line (gchar              *line,
     case IDE_CTAGS_INDEX_ENTRY_FUNCTION:
     case IDE_CTAGS_INDEX_ENTRY_FILE_NAME:
     case IDE_CTAGS_INDEX_ENTRY_ENUMERATION_NAME:
+    case IDE_CTAGS_INDEX_ENTRY_IMPORT:
     case IDE_CTAGS_INDEX_ENTRY_MEMBER:
     case IDE_CTAGS_INDEX_ENTRY_PROTOTYPE:
     case IDE_CTAGS_INDEX_ENTRY_STRUCTURE:
diff --git a/src/plugins/ctags/ide-ctags-index.h b/src/plugins/ctags/ide-ctags-index.h
index 6711dae18..349266769 100644
--- a/src/plugins/ctags/ide-ctags-index.h
+++ b/src/plugins/ctags/ide-ctags-index.h
@@ -36,6 +36,7 @@ typedef enum
   IDE_CTAGS_INDEX_ENTRY_FUNCTION = 'f',
   IDE_CTAGS_INDEX_ENTRY_FILE_NAME = 'F',
   IDE_CTAGS_INDEX_ENTRY_ENUMERATION_NAME = 'g',
+  IDE_CTAGS_INDEX_ENTRY_IMPORT = 'i',
   IDE_CTAGS_INDEX_ENTRY_MEMBER = 'm',
   IDE_CTAGS_INDEX_ENTRY_PROTOTYPE = 'p',
   IDE_CTAGS_INDEX_ENTRY_STRUCTURE = 's',
@@ -115,6 +116,9 @@ ide_ctags_index_entry_kind_to_symbol_kind (IdeCtagsIndexEntryKind kind)
     case IDE_CTAGS_INDEX_ENTRY_VARIABLE:
       return IDE_SYMBOL_VARIABLE;
 
+    case IDE_CTAGS_INDEX_ENTRY_IMPORT:
+      return IDE_SYMBOL_PACKAGE;
+
     case IDE_CTAGS_INDEX_ENTRY_ANCHOR:
     case IDE_CTAGS_INDEX_ENTRY_DEFINE:
     case IDE_CTAGS_INDEX_ENTRY_FILE_NAME:


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