```C++ namespace ns {
class C { void f( // when typing the ( the calltip says "ns::C::f (junk, rubbish)" public: C(junk, rubbish){} ~C(){} };
}; ```
Yep, takes the parameters for the constructor and it uses that as the prototype for the new function that doesn't exist yet.
And ... if there happen to be other functions named `f` the calltips will cycle through the prototypes of those functions and never come back to the erroneous one.
Seems like some extraneous function definition is being made for the calltip. But it never appears in the symbol list. Like as if something is scanning for the ) and using the parameter list immediately before it, ignoring the `public: C(`. But what, its not the parser because the symbol doesn't show in the sidebar?
Seems like some extraneous function definition is being made for the calltip. But it never appears in the symbol list.
Actually it does: when you don't have the `(` yet, the parser extracts `ns::C::f (junk, rubbish)`. Apparently it's the `public:` part that confuses it the most, if you drop it you don't get the erroneous `f` function. So yeah it's not great, but fixing that would require getting the parser not confused by this particular invalid input.
And ... if there happen to be other functions named `f` the calltips will cycle through the prototypes of those functions and never come back to the erroneous one.
That's a "funny" side effect of the details of the issue: once you typed the `(`, the parser doesn't see a `f` any more; and when you cycle through the calltips, apparently (?) we query the possible candidates again, so at this point we don't find the erroneous `ns::C::f` as the parser doesn't report it anymore.
Ahh, I didn't notice that the `f` shows in the symbols until I type the `(`. So the calltips are querying the symbols when I type the `(` but before the parser runs, so it sees the `f` symbol, but by the time I have cycled the calltips the parser has run and removed that symbol.
Guess it all comes back to the parser's tolerance for illegal code that occurs during typing. We have discussed before that it should freeze the symbols if it can't parse right, then it also won't delete the remaining symbols in the file.
Has this been fixed? Can't re-produce it but maybe I'm doing something wrong.
Nup, exactly the same. Copy the example above, delete the ( after f and re-type it.
Note that if you have any other files open that have a function called `f` it will show those in the calltip instead, but thats a different imbecility.
@elextr: Ahh OK, got it, thanks. Is this in Geany itself or ctags?
From @b4n's post I would say its a bit of both.
Closed #1249 via #3032.
github-comments@lists.geany.org