Request for feedback on Signature Assistant

Olivier JG olivier.jg at gmail.com
Fri Oct 29 07:18:52 UTC 2010


Having pushed the rename assistant, I'm going to update the signature 
assistant to complement it better.
In the process, I was thinking to change what it offers as follows:

Editing Definition, offer:
   "Sync declaration -- don't use new names and discard defaults"
   If old types w/ defaults match new types w/ defaults
     "Sync declaration -- use new names and preserve defaults"
     "Sync declaration -- use new names and discard defaults"
   If old types w/ defaults don't match new types w/ defaults
     "Sync declaration -- use new names and discard defaults"
   If there are no defaults in the declaration:
     "Sync declaration -- use new names"
   Bonus/maybe/whatdoyouthink: if defaults are added to the definition, 
offer "move defaults"
Editing Declaration, offer:
   "Rewrite definition -- use new names"
   "Rewrite definition -- don't use new names"

Currently the signature assistant tries really hard to figure out what 
happened to all the new arguments and move the defaults accordingly. 
This has it's problems:
1. When I did that part, I was keeping in mind the ability to have a 
decl with: "void func(int i, int j=0)", and a corresponding definition 
of "void func(int i=0, int j)". GCC says it's ok, but it's really not 
worth it to allow it.
2. It's impossible to actually get it right 100% of the time, which 
makes it look stupid sometimes.

This way, if the old defaults don't work anymore, it'll just discard 
them. That way it can't be wrong, and only in a minority case will you 
have to go and repair your defaults manually. If you add the 
"Bonus/maybe/whatdoyouthink" offer above, assuming people figure it out, 
it'll cover 100% without wrong.

Do you prefer the current behavior? Is there a problem with this 
proposition?

-Olivier JG




More information about the KDevelop-devel mailing list