Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Thomas Martitz thomas.martitz@mailbox.org Date: Sat, 27 Aug 2022 22:44:50 UTC Commit: db1c862d5efc3a6a8aadf4232dda2d0093455f00 https://github.com/geany/geany/commit/db1c862d5efc3a6a8aadf4232dda2d0093455f...
Log Message: ----------- Remove unnecessary "lang" parameter of various functions
In functions where we pass the current file as an argument, we can get the used language from the file and this extra parameter is unnecessary.
Modified Paths: -------------- src/editor.c src/tagmanager/tm_workspace.c src/tagmanager/tm_workspace.h
Modified: src/editor.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2033,7 +2033,7 @@ autocomplete_tags(GeanyEditor *editor, GeanyFiletype *ft, const gchar *root, gsi current_line = sci_get_current_line(editor->sci) + 1;
tags = tm_workspace_find_prefix(root, doc->tm_file, current_line, current_scope, - ft->lang, editor_prefs.autocompletion_max_entries); + editor_prefs.autocompletion_max_entries); found = tags->len > 0; if (found) show_tags_list(editor, tags, rootlen);
Modified: src/tagmanager/tm_workspace.c 10 lines changed, 4 insertions(+), 6 deletions(-) =================================================================== @@ -705,7 +705,6 @@ typedef struct TMSourceFile *file; guint line; const gchar *scope; - TMParserType lang; } CopyInfo;
static gboolean is_any_tag(TMTag *tag, CopyInfo *info) @@ -840,7 +839,7 @@ GPtrArray *tm_workspace_find_prefix(const char *prefix, TMSourceFile *current_file, guint current_line, const gchar *current_scope, - TMParserType lang, guint max_num) + guint max_num) { TMTagAttrType attrs[] = { tm_tag_attr_name_t, 0 }; GPtrArray *tags = g_ptr_array_new(); @@ -850,7 +849,6 @@ GPtrArray *tm_workspace_find_prefix(const char *prefix, copy_info.file = current_file; copy_info.line = current_line; copy_info.scope = current_scope; - copy_info.lang = lang; fill_find_tags_array_prefix(tags, prefix, ©_info, max_num);
/* sort based on how "close" the tag is to current line with local @@ -1207,7 +1205,7 @@ find_scope_members_all(const GPtrArray *tags, const GPtrArray *searched_array, T }
-static GPtrArray *find_namespace_members_all(const GPtrArray *tags, const GPtrArray *searched_array, TMParserType lang) +static GPtrArray *find_namespace_members_all(const GPtrArray *tags, const GPtrArray *searched_array) { GPtrArray *member_tags = NULL; guint i; @@ -1250,9 +1248,9 @@ tm_workspace_find_scope_members (TMSourceFile *source_file, const char *name, { tags = tm_workspace_find(name, NULL, tm_tag_namespace_t, NULL, lang);
- member_tags = find_namespace_members_all(tags, theWorkspace->tags_array, lang); + member_tags = find_namespace_members_all(tags, theWorkspace->tags_array); if (!member_tags) - member_tags = find_namespace_members_all(tags, theWorkspace->global_tags, lang); + member_tags = find_namespace_members_all(tags, theWorkspace->global_tags);
g_ptr_array_free(tags, TRUE); }
Modified: src/tagmanager/tm_workspace.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -58,7 +58,7 @@ GPtrArray *tm_workspace_find(const char *name, const char *scope, TMTagType type
GPtrArray *tm_workspace_find_prefix(const char *prefix, TMSourceFile *current_file, guint current_line, const gchar *current_scope, - TMParserType lang, guint max_num); + guint max_num);
GPtrArray *tm_workspace_find_scope_members (TMSourceFile *source_file, const char *name, gboolean function, gboolean member, const gchar *current_scope, guint current_line, gboolean search_namespace);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).