ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Doxy​Doc

by Rapptz ALL

A sublime text plugin for C++ document autocompletion

Details

  • 1.2.1
  • github.​com
  • github.​com
  • 10 years ago
  • 14 minutes ago
  • 11 years ago

Installs

  • Total 16K
  • Win 7K
  • Mac 3K
  • Linux 6K
Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7
Windows 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

DoxyDoc

DoxyDoc is a plug-in that allows you to auto-complete doc block comments for C++ using Doxygen. Inspired by PhpDoc and DocBlockr this was made due to frustrations due to lack of proper C++ support from DocBlockr. The latter plug-in had no capabilities to parse templated functions or classes and would just leave the comment hanging.

There are no plans to support other languages as DocBlockr does this job fairly well.

Installation

The easy way to install this is through Package Control.

  • Press Ctrl + Shift + P
  • Type “install” without quotes to get to Package Control: Install Package
  • Type “DoxyDoc” without quotes and you'll see this package.

Another way to install this is through running git clone of this repository in your package directory.

The command to do so is the following:

git clone https://github.com/Rapptz/doxydoc.git DoxyDoc

Usage

Just like DocBlockr, pressing /** and then enter or tab would automatically insert the corresponding documentation. There are no keyboard shortcuts to memorise.

As you can see, pressing enter consecutively would automatically continue the comment.

DoxyDoc also supports C++ function documenting in various forms.

A basic function is trivial to document:

If a function has a template parameter, a @tparam property is automatically added as well.

However if the function uses the template type parameter in the function it'll try its best to not include it.

DoxyDoc also supports adding the @return property if the return value is not void.

DoxyDoc also supports basic documenting of class names, templated or not.

Note that all the fields are just Sublime Text snippets, so tabbing over will allow you to seamlessly edit the parameters for the tags.

Along with automatically generating documentation, DoxyDoc allows autocompletion of some common Doxygen snippets as listing all of the supported ones would be extremely big. You can get a list of them by pressing @ and a list will pop up automatically.

A couple things from DocBlockr are lacking though, which you can find in the TODO below.

Issues and Limitations

C++ is notoriously hard to parse, so it'll be insane to say that this so-called parser is perfect as it is far from it. Occasional bugs are sure to pop up every so often, which is why I made this to be as simple as possible. Since the “parser” is essentially a bunch of regex under the hood, some abnormalities are bound to pop up because I chose to take part in two problems rather than one.

Limitations are mostly involving template parameters and some complex functions. I also haven't tried function pointers in function arguments, so that will most likely be faulty as well. You are free to open up an issue in the issue tracker if you believe the bug is too severe or it ruins your flow. You're also welcome to submit a patch yourself to fix the functionality. :)

Todo

  • Allow configuration of options. Some examples:
    • Ability to insert @author tags in the snippets
    • Indentation choice
  • Support other types of comments such as /// and //!
  • Variable documentation