Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Code Completion / Doxygen
Code Completion / Doxygen [message #533269] Wed, 12 May 2010 19:49 Go to next message
Claude  is currently offline Claude Friend
Messages: 2
Registered: May 2010
Junior Member
Hi all,

I've got a little problem while using code completion in CDT.

I've created a C project, and creating a new C source file in it.

I created a new function in this file, say :

void sys_log_buffer(unsigned char log_severity, const char *log_string, ...)
{

}


If I wrote
/**
at the beginning of this line, and press Enter, Eclipse create a comment section like this :

/**
 *
 * @param log_severity
 * @param log_string
 */


This is great but i want to customize a little this default message to make it Doxygen compliant. But my problem is I can't find anywhere in the Editor Preference how i can modify this comment.

I've search in Code Style / Code Templates (try to modify each of us, but with no result)

and also search in Editor / Templates (try to create a new template named /** , or modifying comment templates but with no result too)

Anyone can help me ?

Re: Code Completion / Doxygen [message #534938 is a reply to message #533269] Thu, 20 May 2010 17:52 Go to previous messageGo to next message
Claude  is currently offline Claude Friend
Messages: 2
Registered: May 2010
Junior Member
After more research, it seems to me that this thing is hardcoded in CDT. Anyone know which class/source file is concerned by this ?
Re: Code Completion / Doxygen [message #535875 is a reply to message #534938] Wed, 26 May 2010 07:38 Go to previous messageGo to next message
Harald    is currently offline Harald Friend
Messages: 37
Registered: July 2009
Member
AFAIK:

The extension point is
- org.eclipse.cdt.ui.DocCommentOwner

The contributed Doxygen Tool is in package
- org.eclipse.cdt.ui.text.doctools.doxygen

you can find in plugin
- org.eclipse.cdt.ui

Extending the doctools or contributing a advanced doxygen tool is a task on my todo list, too. The posibility to use a template for function comments etc. would be fine Wink

--Harald
Re: Code Completion / Doxygen [message #646308 is a reply to message #535875] Thu, 23 December 2010 09:41 Go to previous messageGo to next message
Pieter Smith is currently offline Pieter SmithFriend
Messages: 1
Registered: December 2010
Junior Member
I could not find a bug on this, so I made a new one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=333134
If this does not cover everyone's use-cases, please share your thoughts and add a vote.
Re: Code Completion / Doxygen [message #1737537 is a reply to message #535875] Sat, 09 July 2016 14:53 Go to previous messageGo to next message
zanget mike is currently offline zanget mikeFriend
Messages: 4
Registered: July 2016
Junior Member
hi, Harald
i have used cdt for a long time but now i'm pretty sure i want to use the code temp for c/c++ method

would u please tell me how to achieve this?
im going to rebuild the jar you pointed out.
is it necessary??
Re: Code Completion / Doxygen [message #1752397 is a reply to message #1737537] Mon, 23 January 2017 12:02 Go to previous messageGo to next message
zanget mike is currently offline zanget mikeFriend
Messages: 4
Registered: July 2016
Junior Member
after a little struggled with the code, i can make a little change.
now, this is what i found:

change result from func: documentFunctionParameters in file
org.eclipse.cdt\core\org.eclipse.cdt.ui\src\org\eclipse\cdt\ui\text\doctools\doxygen\DoxygenMultilineAutoEditStrategy.java

insert a new line here :
StringBuilder result= new StringBuilder();
--> result.append("@brief ").append(getLineDelimiter());
use mvn install to build the whole project and put the result :
org.eclipse.cdt.ui-6.2.0-SNAPSHOT.jar
to the plugin, then restart eclipse.

but i dont konw how to read the temp.
Re: Code Completion / Doxygen [message #1752474 is a reply to message #1752397] Tue, 24 January 2017 09:20 Go to previous message
zanget mike is currently offline zanget mikeFriend
Messages: 4
Registered: July 2016
Junior Member
another patch is :
in the endof customizeDocumentAfterNewLine:
add:

if(content.indexOf("@brief") >= 0) //$NON-NLS-1$
{
buf.deleteCharAt(buf.length()-1); //delete \n if we have added "@brief"
buf.deleteCharAt(buf.length()-1); //delete \n if we have added "@brief"
buf.deleteCharAt(buf.length()-1); //delete \n if we have added "@brief"
buf.deleteCharAt(buf.length()-1); //delete \n if we have added "@brief"
}
before:
buf.append(indent(content, indentation + MULTILINE_MID, lineDelim));

the comment from :
/**
*
* @brief
* @param str

Become :

/**
* @brief
* @param str

but one little scratch:

/**
* |@brief <------

the cursor is not at appropriate place.
Previous Topic:Eclipse Juno CDT Indexer Not working (C++14)
Next Topic:Trying to run Hello World
Goto Forum:
  


Current Time: Tue Apr 23 09:53:53 GMT 2024

Powered by FUDForum. Page generated in 0.03589 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top