Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sat, 27 Aug 2022 21:57:50 UTC Commit: d5cc1d05fb82218d01f1d61a9329c09a43cf0d77 https://github.com/geany/geany/commit/d5cc1d05fb82218d01f1d61a9329c09a43cf0d...
Log Message: ----------- Enable local tag generation for C/C++
Enable generating these tags both for local variables and function parameters - those are more or less identical for what we will be using local tags for so they can be mapped to the same type.
Local tags aren't interesting for tag files so filter them out when generating these (but this also means that we cannot create unit tests for them).
Modified Paths: -------------- src/symbols.c src/tagmanager/tm_parser.c 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_max_t); + tags = get_tag_list(doc, ~tm_tag_local_var_t); if (tags == NULL) return FALSE;
Modified: src/tagmanager/tm_parser.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -70,8 +70,8 @@ static GHashTable *subparser_map = NULL; {'v', tm_tag_variable_t}, /* variable */ \ {'x', tm_tag_externvar_t}, /* externvar */ \ {'h', tm_tag_undef_t}, /* header */ \ - {'l', tm_tag_undef_t}, /* local */ \ - {'z', tm_tag_undef_t}, /* parameter */ \ + {'l', tm_tag_local_var_t}, /* local */ \ + {'z', tm_tag_local_var_t}, /* parameter */ \ {'L', tm_tag_undef_t}, /* label */ \ {'D', tm_tag_undef_t}, /* macroparam */
@@ -89,7 +89,7 @@ static TMParserMapGroup group_C[] = { {_("Structs"), TM_ICON_STRUCT, tm_tag_union_t | tm_tag_struct_t}, {_("Typedefs / Enums"), TM_ICON_STRUCT, tm_tag_typedef_t | tm_tag_enum_t}, {_("Macros"), TM_ICON_MACRO, tm_tag_macro_t | tm_tag_macro_with_arg_t}, - {_("Variables"), TM_ICON_VAR, tm_tag_variable_t | tm_tag_enumerator_t}, + {_("Variables"), TM_ICON_VAR, tm_tag_variable_t | tm_tag_enumerator_t | tm_tag_local_var_t}, {_("Extern Variables"), TM_ICON_VAR, tm_tag_externvar_t}, {_("Other"), TM_ICON_OTHER, tm_tag_other_t}, };
Modified: src/tagmanager/tm_workspace.c 5 lines changed, 4 insertions(+), 1 deletions(-) =================================================================== @@ -580,6 +580,7 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i TMSourceFile *source_file; GList *includes_files; gchar *temp_file = create_temp_file("tmp_XXXXXX.cpp"); + GPtrArray *filtered_tags;
if (!temp_file) return FALSE; @@ -624,7 +625,9 @@ gboolean tm_workspace_create_global_tags(const char *pre_process, const char **i }
tm_tags_sort(source_file->tags_array, global_tags_sort_attrs, TRUE, FALSE); - ret = tm_source_file_write_tags_file(tags_file, source_file->tags_array); + filtered_tags = tm_tags_extract(source_file->tags_array, ~tm_tag_local_var_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);
cleanup:
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).