GithubHelp home page GithubHelp logo

cschlosser / doxdocgen Goto Github PK

View Code? Open in Web Editor NEW
255.0 255.0 54.0 3.15 MB

Generate doxygen documentation from source code in VS Code

Home Page: https://marketplace.visualstudio.com/items?itemName=cschlosser.doxdocgen

License: MIT License

TypeScript 100.00%
c cpp doxygen hacktoberfest vscode vscode-extension

doxdocgen's People

Contributors

cschlosser avatar daanhuinink avatar dependabot[bot] avatar eternalphane avatar ho-cooh avatar imphil avatar jobtijhuis avatar jogo- avatar lukester1975 avatar rowang077 avatar to-s avatar trxcllnt avatar zamora18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doxdocgen's Issues

can not add function comment in *.c file

Description

Anything you'd like to add

Code example

// Put your code here

Expected result

/**
 * @brief Put the expected comment here
 */

Actual result

/**
 * @brief Put the actually generated comment here
 */

Generate file descriptions

Description

Generate description for files in doxygen.

Expected result

/**
 * @brief 
 * @file issue.hpp
 * @author christophschlosser
 * @date 24.02.2018
 */

Actual result

/**
 * @brief 
 *
 */

Conflict to other extension

Description

I see your work have conflict to 2 extensions that both handles /** multiline comment style:

  • Auto Comment Block: if Auto Comment Block catch the /** first then your extension parse incorrectly (like the example below). I use this since Cpp-tools can't expanse multiline comment to the end */.

Code example

int MovePosXYAcc(const tsCOODXY * const ptPosXY);

Expected result

/**
 * @brief 
 * 
 * @param ptPosXY 
 * @return int 
 */

Actual result

/**
 * @brief 
 * 
 */
  • Cpp-tools: it parses correctly but a little bit late (about 2 seconds after Enter).

I doubt these ones can be solved, but at least please update your instruction manual.
Thanks.

'///' doesn't trigger method

Description

MacOS

Code example

///

Expected result

///

Actual result

///
/// @brief Put the actually generated comment here
/// @param ...
...

Don't create a comment while editing an existing comment.

Description

Chances are I misconfigured this extension, so correct me if this is the case.

Code example

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;
}

Expected result

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;
}

Actual result

/// @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;
}

How to use the extension settings?

Thank you for the great work creating Doxygen Documentation Generator for VS Code. I would like to know how can I access the settings to do the commenting style as shown in the wiki:
image

especially using /brief, /param, /author tags etc..

Thanks a lot ๐Ÿ‘

Double templates aren't working correctly

Parsing of functions with multiple templates isn't working.

Code example

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;

Expected result

/**
 * \brief 
 * 
 * \tparam T 
 * \tparam m 
 * \tparam n 
 * \tparam p
 * \param mat 
 * \return Matrix<T, m, n + p>
 */

Actual result

/**
 * @brief 
 * 
 * @tparam T 
 * @tparam m 
 * @tparam n 
 * @param mat 
 * @return template<std::size_t p> Matrix<T, m, n + p> augment 
 */

functions with templates in their namespace path aren't parsed correctly.

Description

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.

Code example

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);

Expected result

/**
 * @brief 
 * 
 * @tparam T 
 * @tparam m 
 * @tparam n 
 * @param pos 
 * @return std::array<T, n>
 */

Actual result

/**
 * @brief 
 * 
 * @tparam T 
 * @tparam m 
 * @tparam n 
 * @param pos 
 * @return std::array<T, n>& Matrix<T, m, n> 
 */

Support for more languages

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?

Create tests for C++ parsing

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 to add \r\n

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 .

We miss the attribute of the class

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 ;) )

Code example

class A{
    /** [press enter]
    int b;
}

Expected result

class A{
    /**
      * @brief b 
      */
    int b;
}

or at least the possibility to edit a string for the attribute

Actual result

class A{
    /**
      * @brief
      */
    int b;
}

Parsing of all possible operators is not working.

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;
}

Function pointers as function parameters are not recognized in C

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.

Return is included in the generated comment for things that shouldn't have a return.

Description

Many constructs that should have no "return" in the comment block return it in the generated comment.

Code example

Constructor/Desctructors

 RobotController(const std::string &serverName);

Namespaces

 namespace robot_controller {

Classes

 class RobotController {

Class members

ros::NodeHandle nodeHandle;

Expected result

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;

Actual result

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 coverage

Description

Increase code coverage. Mostly negative tests are needed.
Codeparsercontroller maybe should be tested as well.

you are not push the 0.0.8 version to VSCode

Description

Anything you'd like to add

Code example

// Put your code here

Expected result

/**
 * @brief Put the expected comment here
 */

Actual result

/**
 * @brief Put the actually generated comment here
 */

Trigger sequence '///' doesn't give expected result

Description

When using '///' as trigger sequence I don't get the doxygen comment with the same leading characters.

Code example

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
 * 
 */

Expected result

/// @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.

JSDoc support

Description

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.

doxdocgen interprets keywords before void as return value

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!

Can not work with "Better comments"

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.

Wrong \param value generation.

Description

\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.

Code example

std::pair<double, double> MyAppl::MapPoint(double latitude, double longtitude) const

Expected result

/**
 * \brief 
 * 
 * \param latitude 
 * \param longtitude 
 * \return std::pair<double, double> 
 */

Actual result

/**
 * \brief 
 * 
 * \param latitude 
 * \param titude 
 * \return std::pair<double, double> 
 */

Create snippets for doxygen commands

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.

Doesn't parse cpp member pointer names correctly

Description

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

Code example

class foo
{
    int bar;
}

void test(int foo::* memberPointer);

Expected result

class foo
{
    int bar;
}

//! \brief 
//! \param memberPointer
//! \return  
void test(int foo::* memberPointer);

Actual result

class foo
{
    int bar;
}

//! \brief 
//! \param foo:: 
//! \return  
void test(int foo::* memberPointer);

Trigger sequence /** does not work

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;
}

Allow for templating of the DoxyGen comment style.

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.

Cannot read property 'text' of undefined

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)

Separate C++ from C settings

Just add other settings to C++

C settings (as today):

  "doxdocgen.c.commentPrefix": " * ",
  "doxdocgen.c.firstLine": "/**",
  "doxdocgen.c.lastLine":  " */",
  "doxdocgen.c.triggerSequence": "/**",

C++ settings (new):

  "doxdocgen.cpp.commentPrefix": "/// ",
  "doxdocgen.cpp.firstLine": "///",
  "doxdocgen.cpp.lastLine":  "///",
  "doxdocgen.cpp.triggerSequence": "///",

Ability to update the version number without editing it yourself

Description

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:

  • On save
  • On command
  • On Keyboard shortcut

These things could be nice to have: (but can be achievable e.g. git hooks)

  • On git Commit
  • On git Push

Code example

/**
 * @version 0.1
 */

Expected result

/**
 * @version 0.2
 */

Actual result

/**
 * @version 0.1
 */

type identification

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)

Automatic asterisk at start of a new line

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 :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.