<p></p>
<p><b>@techee</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/3185#discussion_r862399195">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>
<blockquote>
<p dir="auto">tm_parser_var_valid_before_declare() should be called here, no?</p>
</blockquote>
<p dir="auto">In fact, I'm less convinced whether <code class="notranslate">tm_parser_var_valid_before_declare()</code> is a good idea now - even though you can declare (i.e. assign) variables after their first appearance in file, I think this pattern is not so common and like in the C/C++ case because of this you will get invalid variables in the autocompletion in many cases which IMO is not worth it.</p>
<blockquote>
<p dir="auto">Also, the whole condition is basically a duplicate of the same in is_valid_autocomplete_tag(). Can is_valid_autocomplete_tag() be made callable from here (perhaps with a different name)?</p>
</blockquote>
<p dir="auto">I was thinking about it but there's small difference - while with autocompletion we have only prefix, here we have the whole symbol name so less "false positives" in the result so I thought I could leave it this way. In any case, I don't have a strong opinion about this and these two could indeed be unified. This function could go to tm_tag.c.</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#discussion_r862399195">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJYKFZXGVJVSDH5AMZDVHWTG3ANCNFSM5UWGU33A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ6LCBITFIFVTRCGZKTVHWTG3A5CNFSM5UWGU33KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOHEQ6J2I.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/958522601</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#discussion_r862399195",
"url": "https://github.com/geany/geany/pull/3185#discussion_r862399195",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>