Author Topic: Parameter name comments  (Read 3279 times)

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Parameter name comments
« on: June 05, 2020, 05:02:39 PM »
As 24.0.2, SlickEdit's auto-list compatible parameters feature will offer to insert the parameter name from the function prototype in a comment (for C-like languages) along with other compatible arguments.

For example:
Code: [Select]
void SomeFunction(bool doSomethingWild=true, bool doSomethingBoring=false);
void AnotherFunction(bool yesno)
{
     SomeFunction(      );
                   // ^ Press Alt+Comma Here
}

In the above case, you will see completions like this (you may have to hit Alt+Comma twice if you have auto-list compatible parameters turned off):
  • /*doSomethingWild*/
  • /*doSomethingWild*/false
  • /*doSomethingWild*/true
  • false
  • true
  • yesno

This feature was added as a convenience since C/C++ does not have named parameter support yet, and improves readability of code, especially when functions take a literal value as an argument.

Code: [Select]
void SomeFunction(bool doSomethingWild=true, bool doSomethingBoring=false);
void AnotherFunction(bool yesno)
{
     SomeFunction(/*doSomethingWild*/yesno, /*doSomethingBoring*/true);
}