<p></p>
<p dir="auto">Have tried this, and first impressions its a big improvement on previously.</p>
<blockquote>
<p dir="auto">On the one hand I don't think it's so common to have a variable declared after its use</p>
</blockquote>
<p dir="auto">As I said above, its allowed and somewhat common in C++ inside class declarations.</p>
<p dir="auto">Since types must be declared before use, members that use public types need to go after that definition, and if the type is public and the data member private its a common idiom to put those data members in one private section at the end of the class declaration rather than swapping back and forth all the time.</p>
<p dir="auto">That means that public constructors and inline functions use the variable name before it is declared as in the example below (with comments about how well autocomplete works in various contexts).</p>
<pre><code>class Foo {
public:
        Foo():iiiii(1){}     // autocompletes iiiii correctly
        void f(){
                int pit;
                iiiii = 2;       // autocompletes iiiii correctly
                if(p){           // autocompletes p first but with lots of C library crap
                        p->i = p->j; // autocompletes ->i and j correctly
                }
                pit = 1;         // autocompletes with ctrl space after p 
                                 // but with pid_t before pit in list
        }
        struct Bar {
                int i, j;
        };
        int operator ()(){   // autocompletes operator
                return iiiii;    // autocompletes iiiii when ctrl space after just i
                             // but with i, id, id_t before iiiii in list
        } 
        ~Foo(){delete p;}
private:
        int iiiii;
        Bar *p;
};

main(){
        Foo* p;
        p->f(); // autocompletes p but with Foo first, tooltip shows for f( correctly
        Foo foo;
        foo();  // no tooltip for foo(
}
</code></pre>
<p dir="auto">As noted there are some places where the sorting seems questionable.</p>
<p dir="auto">Also constructors, <code>Foo()</code> above, should not show in . or -> completions lists (p-> in main() above), they can't be called like that.  Destructors can and show ok.</p>
<p dir="auto">I also opened the above file in vscode and (I guess unsurprisingly) it doesn't have the noted issues.</p>
<p dir="auto">Now for <em>real</em> evil <g-emoji class="g-emoji" alias="imp" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f47f.png">👿</g-emoji> code ...</p>
<p dir="auto">note to self, don't ever autocomplete "get" <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">but a big improvement, seems to not get too scrambled by templates.</p>
<p dir="auto">I have no issue with this being merged, its a great improvement on previous capabilities.  Thanks <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></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/3175#issuecomment-1107684304">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ43PMG5XDZ7Q3CE7LDVGSSXXANCNFSM5T5CX5RA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ7FSFLU3CGKXFFZ34DVGSSXXA5CNFSM5T5CX5RKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIIC6XUA.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/3175/c1107684304</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/3175#issuecomment-1107684304",
"url": "https://github.com/geany/geany/pull/3175#issuecomment-1107684304",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>