Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Doxygen plugin
polygon7:
--- Quote from: Cryogen on July 20, 2010, 07:00:45 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.
--- End quote ---
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
}
--- End code ---
--- 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
}
--- End code ---
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
};
--- End code ---
--- 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
};
--- End code ---
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.
ollydbg:
@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***
...
}
--- End code ---
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;
}
--- End code ---
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);
--- End code ---
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
polygon7:
--- Quote from: ollydbg 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)
--- End quote ---
Thanks! :)
rah2435:
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?
Jenna:
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).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version