Comment_Maker help us to add comment for generating docs.
This extension will be reduce time to writing code and a typing error.
Features
This extension offer function to add comment.
The current version has a lot of constraints.
Command
Show Custom Settings for Comment Generation
the Setting viewer show you the tab that can configure custom comment and project name, revisor.
Generate Detail Comment
This command generate the detail comment for the function declaration.
/*S
* @function
* @name : someFunction
* @parameter :
* @description :
*/
void someFunction(int a);
Generate Normal Comment
This command generate the Normal comment for the file.
/**
*******************
******************************* HEADER FILE ********************************
** ******************* **
** **
** Project : some project **
** Filename : somefile.h **
** Version : -.- (PCB : ) **
** Revised by : some company **
** Date : 2024.04.22 **
** **
******************************************************************************/
/*********************************************************************************************************************/
/*----------------------------------------------------Includes-------------------------------------------------------*/
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*-----------------------------------------------------Macro---------------------------------------------------------*/
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*-------------------------------------------------Global Variable---------------------------------------------------*/
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*-------------------------------------------------Data Structures---------------------------------------------------*/
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*-----------------------------------------------Function Prototypes-------------------------------------------------*/
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*-------------------------------------------------Private Function--------------------------------------------------*/
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*-------------------------------------------------Extern Function---------------------------------------------------*/
/*********************************************************************************************************************/
Generate Description Comment
This command generate the Description comment for each function.
/*S
* @function
* @name : add_function
* @parameter :
* @parameter :
* @return :
* @description :
*/
static int add_function(int x, int y);
static int add_function(int x, int y)
{
/*S calculate each parameter using the addition operator. */
int result = x + y;
/*S return result by add */
return result;
}
In the above code, the function name, return type, and comments between /* and */ are analyzed by AI to write a description.
The OpenAI API is used, and the API key can be set in 'Show Custom Settings for Comment Generation'.
Enjoy!