Code Monkey home page Code Monkey logo

doxygencomments's Introduction

Doxygen Comments

Donate Version Installs Ratings

Do you like the extension? Then please donate to help maintain it (click the first button)


Automatic doxygen comments creation for functions, headers and all other members. The comments formats can be completely customized and updated after a function changed.

Installation

Visual Studio Marketplace: DoxygenComments.

Or in Visual Studio -> Extensions -> Doxygen Comments

Formats

The following formats are the default formats, but the can be customized.

Header

/*****************************************************************//**
 * \file   sampleClass.h
 * \brief 
 *
 * \author Finn 
 * \date   April 2020
***********************************************************************/

Function

/**
 * Set the sample class name.
 * 
 * \param name The name for the sample class
 * \return a sample return value
 */

Getting Started

Type '/**' for single line comments. After the comment is created, press enter or tab to generate the doxygen comment.

To skip the single line format, use '/*!'.

Header can be created by writing '/**' in the first file line, and all other, directly before the wished member.

Different comments

  • Function: Automatic paramets and return values
  • Header: Automatic file, date and author

Customizing

The plugin settings are under Tools -> Options -> Doxygen.

In the pages Header, Function and Default are the customizable formats.
You can use all the listed variables. The \param will be multiplied to the number of parameters of the function and the \return attribute will only be shown without a void return type.

You can replace attributes like \param or \return with everything else (for example: @param), if you use the $PARAMS and $RETURN variables in the same line.

To use the $ character as plain text in your comment you can escape ith with \ (e.g. \$id will be shown as $id in the comment)

If you want you can add custom attributes like \license to always generate a licence in a header comment.

Updating

If you want to update a function documentation after the function was changed, just place the cursor in the function or documentation to update and then you...

  • ... can use the menu Tools/Update Doxygen comment
  • ... or use the shortcut (default Control+Shift+R).

After that, the plugin may show a dialog, but only if there are any unresolved issues. In this dialog you just choose which parameters are the old versions of ones shown in the left column, or select New parameter if you added the paramter.

To change the shortcut, just go into your settings Tools/Options/Envrionment/Keyboard and search for doxygen.

Addtitional Info

If you want to contirbute to this plugin and add a nice feature or fix a bug, feel free to make a pull request in my repository.

Todo

If I have time, or if you want to help, the following features would be nice to implement:

  • IntelliSense Quick Info for doxygen style
  • Share the customized formats in the git repo

This is a fork of dragospop/CppDoxyComplete, but is for VS2019, customizable and has the option to update comments.

doxygencomments's People

Contributors

fingeg avatar

Stargazers

skyline avatar Karon avatar  avatar 社会主义加班人 avatar zoey avatar Lee avatar  avatar pedoc avatar Per Ghosh avatar WL avatar FeJQ avatar Michele Cancilla avatar 马迪 avatar jianhua.zhang avatar MQ avatar Ben avatar  avatar Masahiro AONO avatar

Watchers

James Cloos avatar Kang Lin avatar  avatar Karon avatar

doxygencomments's Issues

Visual Studio 2019 hangs

Hi,

steps to reproduce:

  1. create empty project
  2. put a break point or debug with initial break(f11 i belive)
  3. start typing new variable in watch window like: int *

image

this will hang visual studio

Doxygen Header Broken

Header no longer seems to be recognized and does not auto populate with

/***************************************************************//

  • \file $FILENAME
  • \brief $BRIEF$END
  • \author $USERNAME
  • \date $MONTHNAME_EN $YEAR
    *********************************************************************/

But, instead, just uses the default.

Microsoft Visual Studio Community 2019
Version 16.11.7
VisualStudio.16.Release/16.11.7+31911.196
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2019 00435-60000-00000-AA821
Microsoft Visual C++ 2019

The plugin doesn't work for VS2022 anymore

In VS2022 Comunity/Professional, when I want to add a doxygen style comment to a function, the plugin doesn't work. My colleagues also encountered with the same issue. Do you have a plan to fix this problem?

Does not work in C++ peek windows

Steps to reproduce:

  1. Select some function that's defined elsewhere.
  2. Hit Alt + F12 to Peek Definition.
  3. Try to create a documentation block for the function in the opened peek window.

In the peek window only /**/ is inserted.
* gets inserted in the function call site (ruining it).

More support for C++

Hi author, the plugin is excellent, but I found some imperfections in the process of using it, here are my suggestions

  1. can extract template parameter and generate, instance: @tparam $TPARAMS
  2. can extract the return type, instance: @return $TYPE
  3. can extract the type of formal parameter, instance: @param $PARAMS( $TYPE )

status quo:
image

Renderings:
image

C++ new line brace positioning is affected

Normally when I type:

if (a > b){}  //the closing brace is inserted automatically

and hit enter, I end up with this:

if (a > b) {    
    //the caret is here     
}

With this extension enabled I end up with this:

if (a > b) {  
} //the caret is before the closing brace

The same thing probably happens with functions etc. also.

Settings at Tools > Options > Text Editor > C/C++ > Formatting > New Lines don't seem to have much effect.

\param and \return not generated for method

When creating a doxygen comment for the method in a header file, param and return wont get generated for Foo(). However generations works on the above static function. and in the defining cpp file.
All settings for the plugin are on default, tried reinstalling it.
What should I do? The error seem to show up just sometimes, so hard to say what's causing this.

namespace A::B
{
	class DP_API MyClass
	{
	private:
		static HMODULE DLLModule;

		MyClass() {}

	public:
		/**
		 * Desc.
		 * 
		 * \param dllModule
		 */
		static void SetDLLModule(HMODULE dllModule) { DLLModule = dllModule; }

		/**
		 * Desc.
		 */
		bool Foo(HMODULE aValue);
};

Excess slash when using triple slash style comments.

When changing the template in Options > Doxygen > Function to

/// @brief $BRIEF$END.
///
/// @param $PARAMS
/// @return $RETURN

in order to use the triple slash style /// instead of the JavaDoc style /** */ for doxygen comments, there is an excess slash added to the first line, like so:

//// @brief My function name.
///
/// @param var1
/// @param var2
/// @param var3
/// @param var4
/// @return

Add escape character for the '$'

In the comment format settings the '$' is used for variables and currently cannot be escaped.

Introduce a '\' as escape character: '\$'

Autocomplete malfunctions when this plugin is enabled.

version: 1.0.4

Problem Description

When I choose an item(i) from the auto-complete list, the next item(i+1) will be used.

For example, if I choose addListener, alloc will be used instead.

image

If I disable this plugin, the problem disappears.

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.