Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Thu, 03 Nov 2022 22:25:34 UTC Commit: a24655d61d6bd4b7b7ebb0b1d3a8b3603f43975e https://github.com/geany/geany/commit/a24655d61d6bd4b7b7ebb0b1d3a8b3603f4397...
Log Message: ----------- Process header tags
Enable header tag generation in ctags, introduce new tm_tag_header_t TMTagType. Disable usage of this tag for normal Geany usage such as symbol tree, tag generation or autocompletion. We'll use this tag type only for sorting autocompletion symbols.
Modified Paths: -------------- src/symbols.c src/tagmanager/tm_parser.c src/tagmanager/tm_parser.h src/tagmanager/tm_workspace.c
Modified: src/symbols.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1133,7 +1133,7 @@ gboolean symbols_recreate_tag_list(GeanyDocument *doc, gint sort_mode)
g_return_val_if_fail(DOC_VALID(doc), FALSE);
- tags = get_tag_list(doc, ~tm_tag_local_var_t); + tags = get_tag_list(doc, ~(tm_tag_local_var_t | tm_tag_include_t)); if (tags == NULL) return FALSE;
Modified: src/tagmanager/tm_parser.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -69,7 +69,7 @@ static GHashTable *subparser_map = NULL; {'u', tm_tag_union_t}, /* union */ \ {'v', tm_tag_variable_t}, /* variable */ \ {'x', tm_tag_externvar_t}, /* externvar */ \ - {'h', tm_tag_undef_t}, /* header */ \ + {'h', tm_tag_include_t}, /* header */ \ {'l', tm_tag_local_var_t}, /* local */ \ {'z', tm_tag_local_var_t}, /* parameter */ \ {'L', tm_tag_undef_t}, /* label */ \ @@ -81,7 +81,7 @@ static TMParserMapEntry map_C[] = { /* Used also by other languages than C - keep all the tm_tag_* here even though * they aren't used by C as they might be used by some other language */ static TMParserMapGroup group_C[] = { - {_("Namespaces"), TM_ICON_NAMESPACE, tm_tag_namespace_t | tm_tag_package_t}, + {_("Namespaces"), TM_ICON_NAMESPACE, tm_tag_namespace_t | tm_tag_package_t | tm_tag_include_t}, {_("Classes"), TM_ICON_CLASS, tm_tag_class_t}, {_("Interfaces"), TM_ICON_STRUCT, tm_tag_interface_t}, {_("Functions"), TM_ICON_METHOD, tm_tag_prototype_t | tm_tag_method_t | tm_tag_function_t},
Modified: src/tagmanager/tm_parser.h 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -42,7 +42,8 @@ typedef enum tm_tag_macro_with_arg_t = 131072, /**< Parameterized macro */ tm_tag_local_var_t = 262144, /**< Local variable (inside function) */ tm_tag_other_t = 524288, /**< Other (non C/C++/Java tag) */ - tm_tag_max_t = 1048575 /**< Maximum value of TMTagType */ + tm_tag_include_t = 1048576, /**< C/C++ included header file name */ + tm_tag_max_t = 2097151 /**< Maximum value of TMTagType */ } TMTagType;
Modified: src/tagmanager/tm_workspace.c 7 lines changed, 4 insertions(+), 3 deletions(-) =================================================================== @@ -540,7 +540,7 @@ static gboolean create_global_tags_preprocessed(const char *pre_process_cmd, }
tm_tags_sort(source_file->tags_array, global_tags_sort_attrs, TRUE, FALSE); - filtered_tags = tm_tags_extract(source_file->tags_array, ~tm_tag_local_var_t); + filtered_tags = tm_tags_extract(source_file->tags_array, ~(tm_tag_local_var_t | tm_tag_include_t)); ret = tm_source_file_write_tags_file(tags_file, filtered_tags); g_ptr_array_free(filtered_tags, TRUE); tm_source_file_free(source_file); @@ -573,7 +573,7 @@ static gboolean create_global_tags_direct(GList *source_files, const char *tags_ } }
- filtered_tags = tm_tags_extract(tags, ~tm_tag_local_var_t); + filtered_tags = tm_tags_extract(tags, ~(tm_tag_local_var_t | tm_tag_include_t)); tm_tags_sort(filtered_tags, global_tags_sort_attrs, TRUE, FALSE);
if (filtered_tags->len > 0) @@ -676,7 +676,8 @@ gboolean tm_workspace_is_autocomplete_tag(TMTag *tag, gboolean valid_local = !tag->local || current_file == tag->file;
return valid && valid_local && - !tm_tag_is_anon(tag) && tm_parser_langs_compatible(lang, tag->lang); + !tm_tag_is_anon(tag) && tm_parser_langs_compatible(lang, tag->lang) && + !(tag->type & tm_tag_include_t); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).