cschlosser / doxdocgen Goto Github PK
View Code? Open in Web Editor NEWGenerate doxygen documentation from source code in VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=cschlosser.doxdocgen
License: MIT License
Generate doxygen documentation from source code in VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=cschlosser.doxdocgen
License: MIT License
Anything you'd like to add
// Put your code here
/**
* @brief Put the expected comment here
*/
/**
* @brief Put the actually generated comment here
*/
Generate description for files in doxygen.
/**
* @brief
* @file issue.hpp
* @author christophschlosser
* @date 24.02.2018
*/
/**
* @brief
*
*/
In the examples it si shown that file description templates get Automatically generated.
However I can't get DDG to generate the file descriptions for me.
Suggest text in the generated comment.
I see your work have conflict to 2 extensions that both handles /** multiline comment style:
int MovePosXYAcc(const tsCOODXY * const ptPosXY);
/**
* @brief
*
* @param ptPosXY
* @return int
*/
/**
* @brief
*
*/
I doubt these ones can be solved, but at least please update your instruction manual.
Thanks.
MacOS
///
///
///
/// @brief Put the actually generated comment here
/// @param ...
...
Chances are I misconfigured this extension, so correct me if this is the case.
Configuration:
{
"doxdocgen.c.commentPrefix": "/// ",
"doxdocgen.c.firstLine": "",
"doxdocgen.c.lastLine": "",
"doxdocgen.c.triggerSequence": "///",
}
/// @brief Sums values.
///
/// @param a Value a.
/// @param b Value b.
int hello_world(int a, int b) {
return a + b;
}
Given my cursor is on the second line, even after the space (because we could argue that the space should not be ignored silently in any case), and I press enter:
/// @brief Sums values.
///
/// @param a Value a.
/// @param b Value b.
int hello_world(int a, int b) {
return a + b;
}
or
/// @brief Sums values.
///
///
/// @param a Value a.
/// @param b Value b.
int hello_world(int a, int b) {
return a + b;
}
/// @brief Sums values.
//// @brief
///
/// @param a
/// @param b
/// @return int
/// @param a Value a.
/// @param b Value b.
int hello_world(int a, int b) {
return a + b;
}
Example:
int (*idputs(int (*puts)(const char *)))(const char *);
Generate documents for PHP.
https://github.com/php/php-langspec/blob/master/spec/13-functions.md#grammar-parameter-declaration
Parsing of functions with multiple templates isn't working.
template<typename T, std::size_t m, std::size_t n>
template<std::size_t p>
Matrix<T, m, n + p> augment(
const Matrix<T, m, p>& mat) const;
/**
* \brief
*
* \tparam T
* \tparam m
* \tparam n
* \tparam p
* \param mat
* \return Matrix<T, m, n + p>
*/
/**
* @brief
*
* @tparam T
* @tparam m
* @tparam n
* @param mat
* @return template<std::size_t p> Matrix<T, m, n + p> augment
*/
I am also starting work on this extensions.
Currently template parameters aren't supported at all. I am looking to implement it.
It is possible to seperate the implementation and the declaration of template classes by including the implementation at the end of the class declaration. This leads to a template in the function name. This isn't parsed correctly and leads to bad comments.
template<typename T, std::size_t m, std::size_t n>
std::array<T, n>& Matrix<T, m, n>::at(const std::size_t pos);
/**
* @brief
*
* @tparam T
* @tparam m
* @tparam n
* @param pos
* @return std::array<T, n>
*/
/**
* @brief
*
* @tparam T
* @tparam m
* @tparam n
* @param pos
* @return std::array<T, n>& Matrix<T, m, n>
*/
Instead of using fixed 20 lines to look for the end of the method use a custom value in case someone encounters problems with this limit.
We are close to having C++ support down and the next step would be supporting more languages. I have a preference for C# or Python. Any other suggestions?
Since right now I think we have decent C++ support I would like to add testing to it so it will automatically test a variety of cases and we can move faster to support other languages.
I believe it might be best to start with refactoring out the parses from the editor stuff. This way we can make tests easier for just the parser without having to worry about visual studio code editor stuff.
how can I set to show like that as follow
/**
*****************************************
* @brief
I want to add **********
and \r\n
in the "doxdocgen.generic.order":
,but it doesn't work.
thank yo .
It would be very cool if this would also work for the class attributes.
(Or maybe I did not fully understand how to parametrize it ;) )
class A{
/** [press enter]
int b;
}
class A{
/**
* @brief b
*/
int b;
}
or at least the possibility to edit a string for the attribute
class A{
/**
* @brief
*/
int b;
}
Not all operators are currently working.
The following work:
+
, -
, *
, /
, %
, ห
, &
, |
, ~
, !
, =
, <
, >
, +=
, -=
, *=
, /=
, %=
, ห=
, &=
, |=
, <<
, >>
, >>=
, <<=
, ==
, !=
, <=
, >=
, &&
, ||
, ++
, --
, ,
, ->*
, ->
, []
Of the 38 default operators only ()
is not working correctly.
But besides that there are also the new
, new []
, delete
, and delete[]
operators which work correctly.
What remains are the user-defined conversion operators which currently don't work: http://en.cppreference.com/w/cpp/language/cast_operator
They are used to allow implicit or explicit cast from a type to another type for instance the following will allow implicit conversion from a struct or class to an `int *
explicit operator int*() const { return nullptr; }
The next operator that is not working are the user-defined literal operators. They allow for syntactic sugar to generate your own object based on a literal plus a suffix; http://en.cppreference.com/w/cpp/language/user_literal
for instance the function below allows you you to write double a = 90.0_deg
and it will automatically convert it to radians.
constexpr long double operator"" _deg ( long double deg )
{
return deg*3.141592/180;
}
I propose to add support for multiple languages. I am interested in PHP but maybe other people will also like Python, C#, Java, JavaScript, etc. :)
When i give a function pointer as parameter to a function in C, the parameter is given as @param (my_pointer
to the doxygen comment.
Here's an example:
/**
* @brief
*
* (Detailed description)
*
* @param (my_function_pointer
*/
void foo_bar(void (*my_function_pointer) (unsigned int arg1, char arg2))
Maybe this should look like @param *my_function_pointer
? I actually don't know.
I could check how Sublime Text's Doxygen plugin DoxyDoxygen acts in these situations and give you feedback if you want to.
Many constructs that should have no "return" in the comment block return it in the generated comment.
Constructor/Desctructors
RobotController(const std::string &serverName);
Namespaces
namespace robot_controller {
Classes
class RobotController {
Class members
ros::NodeHandle nodeHandle;
Constructor/Desctructors
/**
* \brief Construct a new Robot Controller object
* \param serverName
*/
RobotController(const std::string &serverName);
Namespaces
/**
* \brief
*/
namespace robot_controller {
Classes
/**
* \brief
*/
class RobotController {
Class members
/**
* \brief
*/
ros::NodeHandle nodeHandle;
Constructor/Desctructors
/**
* \brief Construct a new Robot Controller object
* \param serverName
* \return
*/
RobotController(const std::string &serverName);
Namespaces
/**
* \brief
* \return
*/
namespace robot_controller {
Classes
/**
* \brief
* \return
*/
class RobotController {
Class members
/**
* \brief
* \return
*/
ros::NodeHandle nodeHandle;
Increase code coverage. Mostly negative tests are needed.
Codeparsercontroller maybe should be tested as well.
Anything you'd like to add
// Put your code here
/**
* @brief Put the expected comment here
*/
/**
* @brief Put the actually generated comment here
*/
When using '///' as trigger sequence I don't get the doxygen comment with the same leading characters.
In an empty .cpp
file typing ///
and pressing return gives me
/**
* @file Untitled-1
* @author your name ([email protected])
* @brief
* @version 0.1
* @date 2019-01-29
*
* @copyright Copyright (c) 2019
*
*/
/// @file Untitled-1
/// @author your name ([email protected])
/// @brief
/// @version 0.1
/// @date 2019-01-29
///
/// @copyright Copyright (c) 2019
My company's coding guidelines forbid the usage of multiline comments. It would be really helpful if this could be context sensitive.
Would love to see this extension also support JSDoc generation in Javascript/Typescript/React files.
Having recently switched to VSCode from Sublime Text, I'm deeply missing the DoxyDoxygen package. This VS Code extension seems like a logical starting point to get some of that package's functionality.
Is including JSDoc support within the potential scope of this VSCode extension? I could potentially take on starting the effort.
Generate Java comments.
Hi christoph,
First of all: Thanks for creating this plugin. It makes commenting in VSCode really handy.
Here's the issue:
When a function is declared as static inline void
in C, the plugin recognizes it as a return value.
For example, when my function is named static inline void foo_bar()
, I get the following automated doxygen comment:
/**
* @brief
*
* (Detailed description)
*
* @return static inline void
*/
static inline void foo_bar()
Greetings!
Generate Comments for Javascript
I installed both this plugin and "Better Comments" plugin, and then this plugin doesn't work anymore. I tried to uninstall the "Better Comments" plugin, this plugin works again.
\param
handling gone wrong. Seems like it's some keyword-based approach. I can reproduce this with double
, int
, long
prefix of argument, but not with float
.
std::pair<double, double> MyAppl::MapPoint(double latitude, double longtitude) const
/**
* \brief
*
* \param latitude
* \param longtitude
* \return std::pair<double, double>
*/
/**
* \brief
*
* \param latitude
* \param titude
* \return std::pair<double, double>
*/
Currently comments are only generated for functions. Normally classes, structs, enums and variables also are allowed to be commented in the DoxyGen style.
When multiple symbols are placed after the parenthesis where the function parameters are located results in bad comments.
Matrix<T, n, m> transpose() const noexcept;
/**
* @brief
*
* @return Matrix<T, n, m>
*/
/**
* @brief
*
* @return Matrix<T, n, m> transpose const
*/
We are supporting doxygen commands with template generation but there are a lot more commands that can be generated and it would be really usefull to allow for some kind of intellisense when typing other commands.
So when type some configurable trigger then you get intellisense to add a doxygen command.
When generating a doxy comment for a function that takes a member pointer parameter it uses the second piece of the member pointer type instead of the parameter name
class foo
{
int bar;
}
void test(int foo::* memberPointer);
class foo
{
int bar;
}
//! \brief
//! \param memberPointer
//! \return
void test(int foo::* memberPointer);
class foo
{
int bar;
}
//! \brief
//! \param foo::
//! \return
void test(int foo::* memberPointer);
Issue Type: ?
Extension Name: doxdocgen
Extension Version: 0.4.1
OS Version: Windows 7 Enterprise
VS version: 14.0.25431
VSCode version: 1.30.2
Hi,
I have installed the plugin through VSCode but no matter what I do the trigger sequence does not work in my code.
I tried to apply it to existing code and also to newly created files (c and cpp) but it just did not trigger. I verified that the plugin is installed and enabled. I also tried different version (0.1 and 0.3) but nothing changed.
I also tried to change the sequence itself - but to no avail.
Are there any requirements that I have missed or do I need to disable auto-completion of some sort?
Example code
test.cpp
void func(int a) {
return;
}
can not add function comment in *.c file
Create new gifs and descriptions of the functions introduced in 0.1.0
Example function:
bool fuzzy_equal(const matrix<T, M, N>& mat, T fuzz) const;
Comment that is generated:
/**
* @brief
*
* @param matrix<T
* @param M
* @param mat
* @param fuzz
* @return true
* @return false
*/
Only /**
is supported right now. But DoxyGen allow for many different formats. like ///
or even xml style comment used in C#.
So we need to implement a way to extensively configure the comments that are generated.
Log:
Cannot read property 'text' of undefined: TypeError: Cannot read property 'text' of undefined
at CodeParserController.check (C:\Users\MateuszPaluszkiewicz\.vscode\extensions\cschlosser.doxdocgen-0.3.1\out\CodeParserController.js:44:42)
at CodeParserController.onEvent (C:\Users\MateuszPaluszkiewicz\.vscode\extensions\cschlosser.doxdocgen-0.3.1\out\CodeParserController.js:85:19)
at CodeParserController.vscode_1.workspace.onDidChangeTextDocument (C:\Users\MateuszPaluszkiewicz\.vscode\extensions\cschlosser.doxdocgen-0.3.1\out\CodeParserController.js:26:22)
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:96:784)
at e.$acceptDirtyStateChanged (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:685:973)
at e.$acceptModelSaved (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:685:723)
at e._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:636:832)
at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:636:550)
at e._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:635:631)
at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:635:400)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:634:315
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:637:395
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:95:432
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:96:764)
at Socket.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:154:338)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at Pipe.onread (net.js:560:20)
"doxdocgen.c.commentPrefix": " * ",
"doxdocgen.c.firstLine": "/**",
"doxdocgen.c.lastLine": " */",
"doxdocgen.c.triggerSequence": "/**",
"doxdocgen.cpp.commentPrefix": "/// ",
"doxdocgen.cpp.firstLine": "///",
"doxdocgen.cpp.lastLine": "///",
"doxdocgen.cpp.triggerSequence": "///",
Generate C# comments.
Allow for custom order of doxygen tags
Ability to update the version number without editing it yourself.
When i was configuring doxdoc in vscode i saw that version number was 'hard coded' and didn't see a way to make it variable.
Options:
I would like to see:
These things could be nice to have: (but can be achievable e.g. git hooks)
/**
* @version 0.1
*/
/**
* @version 0.2
*/
/**
* @version 0.1
*/
Generate Python comments.
As a vscode enthusiast with a definite need to improve documentation in projects that I work on, I decided to try out doxdocgen. I started by completely randomly selecting this line to test my first function comment block:
https://github.com/vrtadmin/clamav-devel/blob/master/libclamav/htmlnorm.c#L158
Return type should have been unsigned int, as both return statements in the function return variables of type unsigned int.
The function parameters identified as char instead of chunk, and int instead of len.
Finally I also found that the function name appeared at the end of the @return line instead of at the beginning of the block.
/**
* @brief
*
* @param char
* @param int
* @return unsigned rewind_tospace
*/
static inline unsigned int rewind_tospace(const unsigned char* chunk, unsigned int len)
Hey,
I have many comments that need more specific description of functions.
It would be nice, if a new line inside of the doxygen comment section automatically starts with an asterisk.
Currently, a new line is created like this:
/**
* @brief
*
* Blah Blah, Blubb
* [New line ceated here]
<-- (Cursor here, no asterisk)
* @param foo Does bar.
*/
P.S.: Thank you for the fast reactions on my previous issues :) I Appreciate it :)
Performance
doxdocgen
0.4.1
Linux x64 4.15.0-43-generic
1.30.1
cschlosser.doxdocgen-unresponsive.cpuprofile.txt
Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.