<p></p>
<p><b>@kugel-</b> requested changes on this pull request.</p>

<p dir="auto">I'm not really happy with <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/geany/geany/commit/b710cf3aa1300dd43e4edfcf152f7f3a10f9a686/hovercard" href="https://github.com/geany/geany/commit/b710cf3aa1300dd43e4edfcf152f7f3a10f9a686"><tt>b710cf3</tt></a></p>
<ul dir="auto">
<li>it makes a lot of assumption</li>
<li>it seems really expensive</li>
<li>works only for C/C++ by hardcoding</li>
<li>has nothing to do with local variables</li>
</ul>
<p dir="auto">Please lets discuss that feature in a separate PR. Also, if we want that, then it may make sense to expose that "find header" logic somehow to implement a "go to header" feature (I think ProjectOrganizer already has something like that?)</p><hr>

<p>In <a href="https://github.com/geany/geany/pull/3185#discussion_r862393644">src/symbols.c</a>:</p>
<pre style='color:#555'>>      foreach_ptr_array(tmtag, i, tags)
        {
+               if (tmtag->type & tm_tag_local_var_t &&
+                       (doc->tm_file != tmtag->file ||
+                        current_line < tmtag->line ||
</pre>
<p dir="auto"><code class="notranslate">tm_parser_var_valid_before_declare()</code> should be called here, no?</p>
<p dir="auto">Also, the whole condition is basically a duplicate of the same in <code class="notranslate">is_valid_autocomplete_tag()</code>. Can <code class="notranslate">is_valid_autocomplete_tag()</code> be made callable from here (perhaps with a different name)?</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/3185#discussion_r862394594">src/editor.c</a>:</p>
<pre style='color:#555'>> @@ -601,6 +601,7 @@ static void show_autocomplete(ScintillaObject *sci, gsize rootlen, GString *word
        }
        /* store whether a calltip is showing, so we can reshow it after autocompletion */
        calltip.set = (gboolean) SSM(sci, SCI_CALLTIPACTIVE, 0, 0);
+       SSM(sci, SCI_AUTOCSETORDER, SC_ORDER_CUSTOM, 0);
</pre>
<p dir="auto">I read the docs but I couldn't grasp the difference between <code class="notranslate">SC_ORDER_PRESORTED</code> and <code class="notranslate">SC_ORDER_CUSTOM</code>. In either case scintilla does not sort by itself. <code class="notranslate">SC_ORDER_PRESORTED</code> seems to assume the list is presorted alphabetically but what's the deal with that?</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/3185#discussion_r862395037">src/tagmanager/tm_workspace.c</a>:</p>
<pre style='color:#555'>> +            !(tag->type & tm_tag_local_var_t) &&
+               is_autocomplete_tag(tag, info);
+}
+
+
+static guint copy_tags(GPtrArray *dst, TMTag **src, guint src_len, GHashTable *name_table,
+       gint num, gboolean (*predicate) (TMTag *, CopyInfo *), CopyInfo *info)
+{
+       guint i;
+
+       g_return_val_if_fail(src && dst, 0);
+
+       for (i = 0; i < src_len && num > 0; i++)
+       {
+               TMTag *tag = *src;
+               if (predicate(tag, info) &&
</pre>
<p dir="auto">Every predicate function contains the is_autocomplete_tag() check. I think it makes sense to have that call here (before calling the predicate). The function could be suitably named <code class="notranslate">copy_autocomplete_tags()</code></p>
<p dir="auto">That should perform a bit better</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3185#pullrequestreview-958518326">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ2ULZVNMG4GGFOSYUDVHWNIJANCNFSM5UWGU33A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ743ML75PWIAKUG6DLVHWNIJA5CNFSM5UWGU33KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOHEQ5INQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/pull/3185/review/958518326</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3185#pullrequestreview-958518326",
"url": "https://github.com/geany/geany/pull/3185#pullrequestreview-958518326",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>