Feature #4873 2009-11-09 00:46

jii

"Ins. class methods" comments config.

This is based on the following forum post: 
http://forums.codeblocks.org/index.php?topic=11480

Right clicking and selecting "Insert -> All class methods without 
implementation" is an awesome feature. Unfortunately the 
documentation style doesn't fit my project. It would be very useful to be 
able to configure the comments that will be inserted. 

Here's an example:

By default, it looks like this, when inserting for me a constructor named 
foo:

/** @brief foo
  *
  * @todo: document this function
  */
 foo::foo()
{

}

I'd like to be able to configure it to look differently, such as my current 
team's documentation style which looks like this:

//------------------------------------------------------------------------------
/// Document this function
//------------------------------------------------------------------------------
foo::foo()
//------------------------------------------------------------------------------
{

}
//------------------------------------------------------------------------------

Apparently the boilerplate code (comments before and braces after the 
function signature) is hard coded in codecompletion.cpp. Moving the 
layout to default.conf, where the abbreviations are, would make it 
editable without having to compile Code::Blocks. If it were configurable 
through the UI I would suggest something like the method for 
configuring abbreviations:

// anything I want goes here
$(function signature)
// anything I want goes here, such as { }

Where the $(function signature) is not prompted for but filled in by the 
code that inserts the function signature. In this manner I can have 
whatever boilerplate code I want above and below the function 
signature, such as putting something in between the signature and the 
opening brace, or adding a comment line below the closing brace of the 
function body.
"Inserting all class methods not implemented" is a very powerful feature 
that I was overjoyed to stumble upon. Unfortunately for me I have to go 
back and manually edit all the documentation, which keeps it from being 
useful.
Category
Editing
Status
Open
Close date
 
Assigned to