<p></p>
<blockquote>
<p dir="auto">But <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/techee/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/techee">@techee</a> whichever state you decide on, please document the intended behaviour so I know what to test.</p>
</blockquote>
<p dir="auto">Many observers will have been astonished that I haven't mentioned my favourite topic (documentation) so far.  Thats because any attempt to describe the behaviour has seemed wordy, complex, and confusing.  But I have had an idea which <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/techee/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/techee">@techee</a> can use to do the above, and the manual at the same time <g-emoji class="g-emoji" alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png">😄</g-emoji></p>
<p dir="auto">It appears that using tables<sup><a href="#user-content-fn-1-56e2a465b87b064f2b61eed54b28aad3" id="user-content-fnref-1-56e2a465b87b064f2b61eed54b28aad3" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup> in an appendix will make it clearer (I am not sure the contents are right, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/techee/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/techee">@techee</a> to fix when he decides the version to be merged):</p>
<h1 dir="auto">Autocompletion behaviour</h1>
<h2 dir="auto">C++ Autocompletion<sup><a href="#user-content-fn-2-56e2a465b87b064f2b61eed54b28aad3" id="user-content-fnref-2-56e2a465b87b064f2b61eed54b28aad3" data-footnote-ref="" aria-describedby="footnote-label">2</a></sup></h2>
<table role="table">
<thead>
<tr>
<th>category of symbol</th>
<th>autocomplete list</th>
<th>base for scope completion</th>
</tr>
</thead>
<tbody>
<tr>
<td>function local declared before the cursor</td>
<td>sorted to first group then alphabetically</td>
<td>prioritised first, closest declaration wins</td>
</tr>
<tr>
<td>function local declared after the cursor</td>
<td>sorted to first group then alphabetically</td>
<td>not considered</td>
</tr>
<tr>
<td>data member of class parent to function</td>
<td>sorted to second group then alphabetically</td>
<td>prioritised second</td>
</tr>
<tr>
<td>declaration in header of current file</td>
<td>sorted last group then alphabetically</td>
<td>prioritised third</td>
</tr>
<tr>
<td>other symbol</td>
<td>sorted last group then alphabetically</td>
<td>prioritised last</td>
</tr>
</tbody>
</table>
<p dir="auto">In the Geany manual I would put the tables for each language in an appendix and refer to it from the <a href="https://www.geany.org/manual/current/index.html#autocompletion" rel="nofollow">autocompletion</a> section with a sentence like "For some languages the autocompletion list is ordered by heuristics to attempt to show names that are more likely to be what the user wants close to the top of the list.  See [Autocompletion behaviour] for the list ordering used for languages where it is applied."</p>
<p dir="auto">And in the scope autocompletion section replace the last sentence with "Most languages only parse global definitions and so scope autocompletion will not work for names declared in local scope.  A few languages parse both local and global symbols and this makes it more likely that the base name (eg <code class="notranslate">this_name-></code>) occurs more than once in the available symbols meaning possible scope completions from several types could be mixed.  Geany does not have exact symbol scoping and visibility information to resolve which definition is to be used, so to disambiguate this situation Geany uses a heuristic described in [Autocompletion behaviour] to prioritise the possible completions which are most likely to be what the user wants."</p>
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
<ol dir="auto">
<li id="user-content-fn-1-56e2a465b87b064f2b61eed54b28aad3">
<p dir="auto">sorry its markdown not rest, but I wanted it to show in github <a href="#user-content-fnref-1-56e2a465b87b064f2b61eed54b28aad3" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
<li id="user-content-fn-2-56e2a465b87b064f2b61eed54b28aad3">
<p dir="auto">C++ is not C, so they are different, it is left as an exercise for the reader to make the C table, and in future the Python table <a href="#user-content-fnref-2-56e2a465b87b064f2b61eed54b28aad3" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
</ol>
</section>

<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#issuecomment-1121843559">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ722DUKEXH4C6RMB3LVJHJAFANCNFSM5UWGU33A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ2H3X5XC52ZG3G4AIDVJHJAFA5CNFSM5UWGU33KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOILO7SZY.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/c1121843559</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#issuecomment-1121843559",
"url": "https://github.com/geany/geany/pull/3185#issuecomment-1121843559",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>