Author Topic: Doxygen plugin  (Read 285640 times)

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: Doxygen plugin
« Reply #195 on: July 16, 2010, 02:04:16 pm »
Any chance on a 10.05 '.cbplugin' yet, or are you waiting on resolving the last few issues?

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #196 on: July 19, 2010, 11:09:13 pm »
Any chance on a 10.05 '.cbplugin' yet, or are you waiting on resolving the last few issues?

Yes and no. It still steadfastly refuses to work for me. I'm looking into whether I can either get a pre-built lib from one of the guys to link to or get one of them to build it. It's proving ridiculously difficult. If you can use SVN or a nightly build, I highly recommend doing so.

Sorry.

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: Doxygen plugin
« Reply #197 on: July 20, 2010, 01:31:27 pm »
Hi,
thank you for really cool plugin. :) I have some small suggestions - It would be great if you will add some integration with CodeCompletion plugin
and when somebody will press a key which inserts doxygen comment, DoxyBlocks will detect if in line below carret is function, or class, or struct
(or something else) and automatically insert proper doxygen comment. And another thing - it would be great if you will allow to make custom
"template" for doxygen comments (something like in astyle "source formatter" plugin have for formatting sources).
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Doxygen plugin
« Reply #198 on: July 20, 2010, 01:46:46 pm »
Hi,
thank you for really cool plugin. :) I have some small suggestions - It would be great if you will add some integration with CodeCompletion plugin
and when somebody will press a key which inserts doxygen comment, DoxyBlocks will detect if in line below carret is function, or class, or struct
(or something else) and automatically insert proper doxygen comment. And another thing - it would be great if you will allow to make custom
"template" for doxygen comments (something like in astyle "source formatter" plugin have for formatting sources).

This is a good idea. Codecompletion plug-in has the ability to detect which function the caret was located in. or Which function is behind the caret.

If someone has the plan, I think I would like to help. :D
I think Doxygen has another engine to parse the source code. ( I have see its source code some days ago).
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #199 on: July 20, 2010, 07:00:45 pm »
 Hi there,

thank you for really cool plugin. :) I have some small suggestions - It would be great if you will add some integration with CodeCompletion plugin
and when somebody will press a key which inserts doxygen comment, DoxyBlocks will detect if in line below carret is function, or class, or struct
(or something else) and automatically insert proper doxygen comment. And another thing - it would be great if you will allow to make custom
"template" for doxygen comments (something like in astyle "source formatter" plugin have for formatting sources).

No problem, thanks. Well, it does that already via regular expressions, without CodeCompletion, but it could certainly be extended. For example, I don't think classes are detected at present and that should be easy to do. I have thought about a custom template but haven't looked at it. For me it's unnecessary but I'd like it to be as flexible as possible.

[EDIT] No, I was wrong, classes are detected. If you're expecting the docs to look like this:

Code
/*! \class Test class.h "inc/class.h"
 *  \brief This is a test class.
 *
...

then you'll be disappointed as that's only necessary for remote documentation, which DoxyBlocks isn't going to do for you. You might like to read a bit more about doxygen to understand what I mean, if necessary. DoxyBlocks can certainly create a default block for you and then you only need to insert the specific tag e.g. \class. Another way you might approach it is to create the documentation block at the item's location so that DoxyBlocks picks up the args, etc, then move it the remote location and add the type tag, e.g. \class. Unfortunately, there is no way that it can interpret every possible scenario.

Cheers.
« Last Edit: July 20, 2010, 07:12:04 pm by Cryogen »

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: Doxygen plugin
« Reply #200 on: July 21, 2010, 07:05:55 pm »
No problem, thanks. Well, it does that already via regular expressions, without CodeCompletion, but it could certainly be extended. For example, I don't think classes are detected at present and that should be easy to do. I have thought about a custom template but haven't looked at it. For me it's unnecessary but I'd like it to be as flexible as possible.
Hi,
I know doxygen tags and I can write it by hand but I'm bit lazy :) and it would be very helpful if DoxyBlock would insert basic tags for me automatically (this is what is missing for me in some older version of DoxyBlocks which I use), eg. for methods and functions.

Code
int foobar(int something, long other)
{
// Before DoxyBlocks
}

Code
/**
 * \since [current date]
 * \author [current user, or user-chosen value - something similar like ToDo plugin have]
 * \brief
 *
 * \param something -
 * \param other -
 *
 * \retval
 */
int foobar(int something, long other)
{
// After DoxyBlocks
}

and something similar for structures and classes (with \tparam) would be very nice:

Code
template
<
 class T,
 class TT,
 class TTT
>
class FooBar
{
// Before DoxyBlocks
};

Code
/**
 * \since [current date]
 * \class FooBar
 *
 * \author [current user, or user-chosen value - something similar like ToDo plugin have]
 * \brief
 *
 * \tparam T -
 * \tparam TT -
 * \tparam TTT -
 */
template
<
 class T,
 class TT,
 class TTT
>
class FooBar
{
// After DoxyBlocks
};

If DoxyBlocks support that already (I didn't update C::B to latest svn yet :P ), then sorry for noise and thanks again for great plugin.
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Doxygen plugin
« Reply #201 on: July 25, 2010, 01:50:50 pm »
@polygon7
I have write my suggestions here about How does CC can support Doxygen. ( I wrote it here, because I hope others can benefit too :D)
Basically, When you caret are located here, before some functions:

Code
*** Your caret position A***
void functionXXX ( )
{
*** Your caret position B***
...
}

If your location is B, then I think in Codecompletions source code, you can easily find the Token around B. See the source snippet:
Code
int NativeParser::FindCurrentFunctionStart(cbEditor* editor, wxString* nameSpace, wxString* procName, int caretPos)
{
    ...

    TokenIdxSet result;
    size_t num_results = m_pParser->FindTokensInFile(editor->GetFilename(), result, tkFunction|tkConstructor|tkDestructor);
    if (s_DebugSmartSense)
        Manager::Get()->GetLogManager()->DebugLog(F(_T("FindCurrentFunctionStart() Found %d results"), num_results));

    TokensTree* tree = m_pParser->GetTokens();
    for (TokenIdxSet::iterator it = result.begin(); it != result.end(); ++it)
    {
        if (s_DebugSmartSense)
            Manager::Get()->GetLogManager()->DebugLog(_T("FindCurrentFunctionStart() (Next) Iteration..."));
        Token* token = tree->at(*it);
        if (token)
        {
            if (s_DebugSmartSense)
                Manager::Get()->GetLogManager()->DebugLog(F(_T("FindCurrentFunctionStart() Iterating: tN='%s', tF='%s', tStart=%d, tEnd=%d"),
                                                            token->DisplayName().wx_str(), token->GetFilename().wx_str(), token->m_ImplLineStart, token->m_ImplLineEnd));
            // found a matching function; check its bounds
            if (token->m_ImplLineStart <= (size_t)line && token->m_ImplLineEnd >= (size_t)line)
            {
                // got it :)
                if (s_DebugSmartSense)
                    Manager::Get()->GetLogManager()->DebugLog(F(_T("FindCurrentFunctionStart() Current function: '%s' (at line %d)"),
                                                                token->DisplayName().wx_str(),
                                                                token->m_ImplLine));

                s_LastNS     = token->GetNamespace();
                s_LastPROC   = token->m_Name;
                s_LastResult = control->PositionFromLine(token->m_ImplLine - 1);

                // locate function's opening brace
                while (s_LastResult < control->GetTextLength())
                {
                    wxChar ch = control->GetCharAt(s_LastResult);
                    if (ch == _T('{'))
                        break;
                    else if (ch == 0)
                    {
                        if (s_DebugSmartSense)
                            Manager::Get()->GetLogManager()->DebugLog(_T("FindCurrentFunctionStart() Can't determine functions opening brace..."));
                        return -1;
                    }

                    ++s_LastResult;
                }

                if (nameSpace) *nameSpace = s_LastNS;
                if (procName)  *procName  = s_LastPROC;

                if (s_DebugSmartSense)
                    Manager::Get()->GetLogManager()->DebugLog(F(_T("FindCurrentFunctionStart() Namespace='%s', proc='%s' (returning %d)"),
                                                                s_LastNS.wx_str(), s_LastPROC.wx_str(), s_LastResult));
                return s_LastResult;
            }
            else if (s_DebugSmartSense)
                Manager::Get()->GetLogManager()->DebugLog(F(_T("FindCurrentFunctionStart() Function out of bounds: tN='%s', tF='%s', tStart=%d, tEnd=%d, line=%d (size_t)line=%d"),
                                                            token->DisplayName().wx_str(), token->GetFilename().wx_str(), token->m_ImplLineStart, token->m_ImplLineEnd, line, (size_t)line));
        }
    }

    if (s_DebugSmartSense)
        Manager::Get()->GetLogManager()->DebugLog(_T("FindCurrentFunctionStart() Can't determine current function..."));

    s_LastResult = -1;
    return -1;
}

Note that all the Token information was in TokensTree, so, first, you need to get all the tokens belong to the current file, this is done by calling:

Code
    TokenIdxSet result;
    size_t num_results = m_pParser->FindTokensInFile(editor->GetFilename(), result, tkFunction|tkConstructor|tkDestructor);
The last argument is a mask. If you want to other information, you can change the "mark".

Onec you get the result, you just do a loop on it and find which Token covers your current line.

Finally, you find some one, for my example, you will find the Token " void functionXXX ( ) ", so, you can do everything you like to do.  :D


If you caret is located in position A, I think you can still do the loop in the result, and find the nearest token behind your current line.  :D

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: Doxygen plugin
« Reply #202 on: July 25, 2010, 02:04:05 pm »
@polygon7
I have write my suggestions here about How does CC can support Doxygen. ( I wrote it here, because I hope others can benefit too :D)

Thanks! :)
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline rah2435

  • Single posting newcomer
  • *
  • Posts: 2
Re: Doxygen plugin
« Reply #203 on: July 30, 2010, 05:26:15 pm »
Anything new on this?

I'm getting the same "missing symbols?" error when trying to install the plugin in C::B version 10.05 on both Ubuntu 10.04 and Windows 7.

I downloaded the plugin file...do I need other files as well? 

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Doxygen plugin
« Reply #204 on: July 30, 2010, 07:49:53 pm »
On ubuntu you can use my repo, but you need the wxwidgets packages from apt.wxwidgets.org, because the ubuntu libs are not compatible with the libs provided by the wxwidgets devs themselves.
Yesterday I downloaded svn r6435 that includes Doxigen plugin (and some others).

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #205 on: August 06, 2010, 10:32:28 pm »

 Hi,

Anything new on this?

I'm getting the same "missing symbols?" error when trying to install the plugin in C::B version 10.05 on both Ubuntu 10.04 and Windows 7.

I downloaded the plugin file...do I need other files as well? 

If you read through the history you'll see that there is currently no compatible .cbplugin for any release version, let alone 10.5. I'm still chasing killerbot to build one but I'm also without a computer at present (it died!! :-() so it's not happening quickly.

Cheers.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Doxygen plugin
« Reply #206 on: August 07, 2010, 03:39:49 am »
My attempt to make an plugin worked; but I have no idea if the plugin works.

The plugin loaded on my Windows 7 32 computer.

Anyone have a site I can upload the Windows Doxygen Plugin to or an email address of a person who wants to test the plugin?

The file is about 700k in size.

Tim S.
« Last Edit: August 07, 2010, 04:06:27 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #207 on: August 24, 2010, 10:26:46 pm »

 Hey Tim,

My attempt to make an plugin worked; but I have no idea if the plugin works.

The plugin loaded on my Windows 7 32 computer.

Anyone have a site I can upload the Windows Doxygen Plugin to or an email address of a person who wants to test the plugin?

Apologies for the slow response, I've been in purgatory without a computer for 5 weeks or so.  :cry:

I'd be happy to do those things for you. You can send me the details via PM here or the SF address. If you can't attach files to either, just let me know where I can grab it from, attach it here, or something suitable. I'll put on the existing SF site it it works.

Thanks.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #208 on: September 03, 2010, 06:50:21 am »

 Hi Guys,

This is just a note to advise that the SourceForge project at https://sourceforge.net/projects/doxyblocks/ and the docs at http://doxyblocks.sourceforge.net/ have been abandoned, since they no longer serve a useful purpose. The old docs have been removed. The docs are now at the wxSmith Addons site listed below. The .cbplugin file releases have been removed to avoid confusion as they never worked for anyone else anyway. The project itself and the old SVN repository will remain for posterity but there will be no further updates. Development is now occurring in the Code::Blocks SVN repository. If and when I manage to obtain .cbplugins for V10.5, they will go on the wxSmith Addons site.

Thanks,

  Cryo.


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Doxygen plugin
« Reply #209 on: September 04, 2010, 08:45:24 am »
Here is my test on doxygen, which I just right click on the function name and would like to add the block comment

Quote
        /** \brief
         *
         * \param
         * \param
         * \return
         *
         */                                                     
        size_t FindAIMatches(std::queue<ParserComponent> components,
                             TokenIdxSet& result,
                             int parentTokenIdx = -1,
                             bool fullMatch = false,
                             bool caseSensitive = false,
                             bool use_inheritance = true,
                             short int kindMask = 0xFFFF,
                             TokenIdxSet* search_scope = 0);


        /** \brief
         *
         * \param actual const wxString&
         * \param components std::queue<ParserComponent>&
         * \return size_t
         *
         */                                                     
        size_t BreakUpComponents(const wxString& actual, std::queue<ParserComponent>& components);

So,
1, I guess the function parameter in multiply lines are not supported.
2, I think we don't need to add the "type" information , so "\param actual" is enough.

any comments?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.