Merge pull request #3268 from techee/local_tags

Ignore local tags for autocompletion in other files
This commit is contained in:
Jiří Techet 2022-09-04 22:28:41 +02:00 committed by GitHub
commit 5b12e286ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -637,7 +637,12 @@ gboolean tm_workspace_is_autocomplete_tag(TMTag *tag,
(current_file == tag->file &&
current_line >= tag->line &&
g_strcmp0(current_scope, tag->scope) == 0);
return valid && !tm_tag_is_anon(tag) && tm_parser_langs_compatible(lang, tag->lang);
/* tag->local indicates per-file-only visibility such as static C functions */
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);
}