Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: vongodric on August 21, 2006, 12:25:54 pm

Title: feature request
Post by: vongodric on August 21, 2006, 12:25:54 pm
dunno if this is the right topic, but I have a small request: If I type: /** and press enter then sceleton of the documentation be automatically generated. Als in doc comment if a enter a new line (press enter) then automatically * would be added. Both eclipse ide and Zend Studio (for php) have this and I find it very nice feature. So it would be nice to have in C::B
Title: Re: feature request
Post by: vongodric on August 24, 2006, 09:11:19 am
Is it possible that this will be added?
Title: Re: feature request
Post by: MortenMacFly on August 24, 2006, 09:27:37 am
Is it possible that this will be added?
It isn't as easy as you may think. Keep in mind that C::B supports a wide range of compilers and languages. Only for C++ (and a few others) this makes sense. But not in general. So one would need to know if the current editor's file belongs e.g. to a C++ project and then trigger this "autocompletion".
Anyway: To have an abstract comment (as e.g. the header of a file) you can use abbreviations:
- go to settings - editor - abbreviations
- add an abbreviation, e.g. head
- in the code window just write the abtract header you would like to have, e.g.
Code
/**
 * Author:  MortenMacFly
 * Version:
 */
- click ok
- open a file in the editor and type head
- press CTRL+J to do the abbreviation. done.

BTW: If you put a pipe-symbol ("|") just after "Version: " the cursor would be at this point after the abbreviation.

With regards, Morten.
Title: Re: feature request
Post by: vongodric on August 24, 2006, 12:52:29 pm
yes it's a nice feature but not what I wanted.

But I don't think it's as hard as you make it to seem. basically if "enter" is pressed, you do 2 checks, if it's c/c++ document and then, if current style is comment_doc. If yes, add indentation, add * and one space too.

later it would be cool if I type: /** then c::b would check for what follows. if it's a function then add smth like:
Code: cpp
/**
 * function name
 * |
 * @param ...
 * @return ...
 */

Or maybe this could be added as a plugin?