Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sun, 23 Jan 2022 16:44:14 UTC Commit: c1e0ae3851c8abf01642693c19fd7f8671060924 https://github.com/geany/geany/commit/c1e0ae3851c8abf01642693c19fd7f86710609...
Log Message: ----------- Rename tm_parser_context_separator() to tm_parser_scope_separator()
This thing is called "scope separator" officially in ctags and when someone adds a new parser to Geany, it's unnecessary to cause a confusion to that person by strange naming.
Modified Paths: -------------- HACKING src/editor.c src/symbols.c src/tagmanager/tm_parser.c src/tagmanager/tm_parser.h src/tagmanager/tm_tag.c src/tagmanager/tm_workspace.c
Modified: HACKING 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -676,7 +676,7 @@ MAP_ENTRY(FOO) to parser_map. (You may want to make the symbols.c change before doing this).
In src/tagmanager/tm_parser.c: -Update tm_parser_context_separator() and tm_parser_has_full_context() to +Update tm_parser_scope_separator() and tm_parser_has_full_context() to handle the new parser if applicable, by adding a TM_PARSER_FOO case entry.
In filetypes.c, init_builtin_filetypes():
Modified: src/editor.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -645,7 +645,7 @@ static void show_tags_list(GeanyEditor *editor, const GPtrArray *tags, gsize roo static gint scope_autocomplete_suffix(ScintillaObject *sci, TMParserType lang, gint pos, gboolean *scope_sep) { - const gchar *sep = tm_parser_context_separator(lang); + const gchar *sep = tm_parser_scope_separator(lang); const gsize max_len = 3; gboolean is_scope_sep; gchar *buf; @@ -708,7 +708,7 @@ static gboolean autocomplete_scope(GeanyEditor *editor, const gchar *root, gsize gboolean scope_sep_typed = FALSE; gboolean ret = FALSE; const gchar *current_scope; - const gchar *context_sep = tm_parser_context_separator(ft->lang); + const gchar *context_sep = tm_parser_scope_separator(ft->lang); gint autocomplete_suffix_len;
if (autocomplete_scope_shown) @@ -1866,7 +1866,7 @@ static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) { const TMTagType arg_types = tm_tag_function_t | tm_tag_prototype_t | tm_tag_method_t | tm_tag_macro_with_arg_t; - const gchar *scope_sep = tm_parser_context_separator(ft->lang); + const gchar *scope_sep = tm_parser_scope_separator(ft->lang); gchar *scope = EMPTY(tag->scope) ? g_strdup(tag->name) : g_strjoin(scope_sep, tag->scope, tag->name, NULL);
Modified: src/symbols.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -265,7 +265,7 @@ GString *symbols_find_typenames_as_string(TMParserType lang, gboolean global) GEANY_API_SYMBOL const gchar *symbols_get_context_separator(gint ft_id) { - return tm_parser_context_separator(filetypes[ft_id]->lang); + return tm_parser_scope_separator(filetypes[ft_id]->lang); }
@@ -338,7 +338,7 @@ static GList *get_tag_list(GeanyDocument *doc, TMTagType tag_types) gboolean filtered = FALSE; gchar **val; gchar *full_tagname = g_strconcat(tag->scope ? tag->scope : "", - tag->scope ? tm_parser_context_separator(tag->lang) : "", + tag->scope ? tm_parser_scope_separator(tag->lang) : "", tag->name, NULL); gchar *normalized_tagname = g_utf8_normalize(full_tagname, -1, G_NORMALIZE_ALL);
@@ -1228,7 +1228,7 @@ static void update_parents_table(GHashTable *table, const TMTag *tag, const GtkT else { /* build the fully qualified scope as get_parent_name() would return it for a child tag */ - name_free = g_strconcat(tag->scope, tm_parser_context_separator(tag->lang), tag->name, NULL); + name_free = g_strconcat(tag->scope, tm_parser_scope_separator(tag->lang), tag->name, NULL); name = name_free; }
Modified: src/tagmanager/tm_parser.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -823,7 +823,7 @@ void tm_parser_verify_type_mappings(void) * zero otherwise. */ gint tm_parser_scope_autocomplete_suffix(TMParserType lang, const gchar *str) { - const gchar *sep = tm_parser_context_separator(lang); + const gchar *sep = tm_parser_scope_separator(lang);
if (g_str_has_suffix(str, sep)) return strlen(sep); @@ -957,7 +957,7 @@ gchar *tm_parser_format_function(TMParserType lang, const gchar *fname, const gc if (scope) { g_string_append(str, scope); - g_string_append(str, tm_parser_context_separator(lang)); + g_string_append(str, tm_parser_scope_separator(lang)); } g_string_append(str, fname); g_string_append_c(str, ' '); @@ -1001,7 +1001,7 @@ gchar *tm_parser_format_function(TMParserType lang, const gchar *fname, const gc }
-const gchar *tm_parser_context_separator(TMParserType lang) +const gchar *tm_parser_scope_separator(TMParserType lang) { switch (lang) { @@ -1034,7 +1034,7 @@ gboolean tm_parser_has_full_context(TMParserType lang) { switch (lang) { - /* These parsers include full hierarchy in the tag scope, separated by tm_parser_context_separator() */ + /* These parsers include full hierarchy in the tag scope, separated by tm_parser_scope_separator() */ case TM_PARSER_ACTIONSCRIPT: case TM_PARSER_C: case TM_PARSER_CPP:
Modified: src/tagmanager/tm_parser.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -139,7 +139,7 @@ gchar *tm_parser_format_variable(TMParserType lang, const gchar *name, const gch gchar *tm_parser_format_function(TMParserType lang, const gchar *fname, const gchar *args, const gchar *retval, const gchar *scope);
-const gchar *tm_parser_context_separator(TMParserType lang); +const gchar *tm_parser_scope_separator(TMParserType lang);
gboolean tm_parser_has_full_context(TMParserType lang);
Modified: src/tagmanager/tm_tag.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -781,7 +781,7 @@ void tm_tags_array_print(GPtrArray *tags, FILE *fp) */ gint tm_tag_scope_depth(const TMTag *t) { - const gchar *context_sep = tm_parser_context_separator(t->lang); + const gchar *context_sep = tm_parser_scope_separator(t->lang); gint depth; char *s; if(!(t && t->scope))
Modified: src/tagmanager/tm_workspace.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -750,7 +750,7 @@ find_scope_members_tags (const GPtrArray *all, TMTag *type_tag, gboolean namespa member_types = tm_tag_max_t;
if (type_tag->scope && *(type_tag->scope)) - scope = g_strconcat(type_tag->scope, tm_parser_context_separator(type_tag->lang), type_tag->name, NULL); + scope = g_strconcat(type_tag->scope, tm_parser_scope_separator(type_tag->lang), type_tag->name, NULL); else scope = g_strdup(type_tag->name);
@@ -785,7 +785,7 @@ static gchar *strip_type(const gchar *scoped_name, TMParserType lang) if (scoped_name != NULL) { /* remove scope prefix */ - const gchar *sep = tm_parser_context_separator(lang); + const gchar *sep = tm_parser_scope_separator(lang); const gchar *base = g_strrstr(scoped_name, sep); gchar *name = base ? g_strdup(base + strlen(sep)) : g_strdup(scoped_name);
@@ -881,7 +881,7 @@ find_scope_members (const GPtrArray *tags_array, const gchar *name, TMSourceFile static gboolean member_at_method_scope(const GPtrArray *tags, const gchar *method_scope, TMTag *member_tag, TMParserType lang) { - const gchar *sep = tm_parser_context_separator(lang); + const gchar *sep = tm_parser_scope_separator(lang); gboolean ret = FALSE; gchar **comps; guint len;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).