[SCM] vim-scripts packaging branch, master, updated. v20091011-30-gc476b42
James Vega
jamessan at debian.org
Sun Aug 14 03:26:58 UTC 2011
The following commit has been merged in the master branch:
commit b756ab7918d23c4931b401b02ab07041497e4123
Author: James Vega <jamessan at debian.org>
Date: Sat Jun 25 23:08:31 2011 -0400
Update DoxygenToolkit to 0.2.13
Signed-off-by: James Vega <jamessan at debian.org>
diff --git a/debian/changelog b/debian/changelog
index 5186da8..3b8cb1f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,7 +4,7 @@ vim-scripts (20091012) UNRELEASED; urgency=low
manage with vim-addon-manager. (Closes: #555621)
* Updated addons:
- supertab: Updated to 1.5
- - DoxygenToolkit: Update to 0.2.7
+ - DoxygenToolkit: Update to 0.2.13
- Color Sampler Pack: Update to 8.03
- vcscommand: Update to 1.99.35
- calendar: Update to 2.0
diff --git a/debian/vim-scripts.status b/debian/vim-scripts.status
index 657c2bc..dee9a78 100644
--- a/debian/vim-scripts.status
+++ b/debian/vim-scripts.status
@@ -298,7 +298,7 @@ author_url: http://www.vim.org/account/profile.php?user_id=5172
email: mathias_lorente at yahoo.fr
license: no license
disabledby: let loaded_DoxygenToolkit = 1
-version: 0.2.7
+version: 0.2.13
script_name: autoload/omni/cpp/complete.vim
addon: omnicppcomplete
diff --git a/html/index.html b/html/index.html
index 5dd31e7..6f29bae 100644
--- a/html/index.html
+++ b/html/index.html
@@ -50,7 +50,7 @@
<li><a href="syntax_mkd.vim.html">syntax/mkd.vim.html</a></li>
</ul>
<p>
- Page generated on Sat, 25 Jun 2011 23:04:12 -0400
+ Page generated on Sat, 25 Jun 2011 23:07:39 -0400
.
</p>
</body>
diff --git a/html/plugin_DoxygenToolkit.vim.html b/html/plugin_DoxygenToolkit.vim.html
index f14ed1a..6faf25e 100644
--- a/html/plugin_DoxygenToolkit.vim.html
+++ b/html/plugin_DoxygenToolkit.vim.html
@@ -166,8 +166,14 @@
<tr>
<td class="lightbg"><b> script karma </b></td>
<td>
- Rating <b>219/95</b>,
- Downloaded by 6251 </td>
+ Rating <b>328/149</b>,
+ Downloaded by 9862 </td>
+ <td class="lightbg">
+ <b> Comments, bugs, improvements </b>
+ </td>
+ <td>
+ <a href="http://vim.wikia.com/wiki/Script:987">Vim wiki</a>
+ </td>
</tr>
</table>
<p>
@@ -217,6 +223,54 @@ Click on the package to download.
<th valign="top">release notes</th>
</tr>
<tr>
+ <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=14064">DoxygenToolkit.vim</a></td>
+ <td class="rowodd" valign="top" nowrap><b>0.2.13</b></td>
+ <td class="rowodd" valign="top" nowrap><i>2010-10-16</i></td>
+ <td class="rowodd" valign="top" nowrap>7.0</td>
+ <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=5172">Mathias Lorente</a></i></td>
+ <td class="rowodd" valign="top" width="2000">Correct insertion position and 'xxx_post' parameters.
<br> - Insert position is correct when g:DoxygenToolkit_compactOneLineDoc = "yes" and let g:DoxygenToolkit_commentType = "C++" are set.
<br> - When you define:
<br> g:DoxygenToolkit_briefTag_pre = "@brief "
<br> g:DoxygenToolkit_briefTag_post = "<++>"
<br> g:DoxygenToolkit_briefTag_funcName = "yes"
<br> Documentation generated with these parameters is something like:
<br> /// @brief foo <++>
<br> You can configure similarly parameters to get something like:
<br> /// @brief foo <++>
<br> /// @param bar <++>
<br> /// @param baz <++></td>
+</tr>
+<tr>
+ <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=13796">DoxygenToolkit.vim</a></td>
+ <td class="roweven" valign="top" nowrap><b>0.2.12</b></td>
+ <td class="roweven" valign="top" nowrap><i>2010-09-09</i></td>
+ <td class="roweven" valign="top" nowrap>7.0</td>
+ <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=5172">Mathias Lorente</a></i></td>
+ <td class="roweven" valign="top" width="2000">Position the cursor at the right position for one line documentation.
<br>(thanks to brian kropf)</td>
+</tr>
+<tr>
+ <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=13675">DoxygenToolkit.vim</a></td>
+ <td class="rowodd" valign="top" nowrap><b>0.2.11</b></td>
+ <td class="rowodd" valign="top" nowrap><i>2010-08-25</i></td>
+ <td class="rowodd" valign="top" nowrap>7.0</td>
+ <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=5172">Mathias Lorente</a></i></td>
+ <td class="rowodd" valign="top" width="2000">Remove trailing blank characters where they are not needed. (Thanks to Lukas Grässlin)</td>
+</tr>
+<tr>
+ <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=13524">DoxygenToolkit.vim</a></td>
+ <td class="roweven" valign="top" nowrap><b>0.2.10</b></td>
+ <td class="roweven" valign="top" nowrap><i>2010-08-08</i></td>
+ <td class="roweven" valign="top" nowrap>7.0</td>
+ <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=5172">Mathias Lorente</a></i></td>
+ <td class="roweven" valign="top" width="2000">'extern' keyword added in list of values to ignore for return type.</td>
+</tr>
+<tr>
+ <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=13521">DoxygenToolkit.vim</a></td>
+ <td class="rowodd" valign="top" nowrap><b>0.2.9</b></td>
+ <td class="rowodd" valign="top" nowrap><i>2010-08-08</i></td>
+ <td class="rowodd" valign="top" nowrap>7.0</td>
+ <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=5172">Mathias Lorente</a></i></td>
+ <td class="rowodd" valign="top" width="2000">Correct bugs related to templates and add support for throw statement (many thanks to Dennis Lubert):
<br>- Template parameter of different type from class and typename are recognized.
<br>- Indentation mistake while detecting template.
<br>- New options are available: g:DoxygenToolkit_throwTag_pre (default set to '@throw ', can be changed to '@exception ' and g:DoxygenToolkit_throwTag_post
<br></td>
+</tr>
+<tr>
+ <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=13505">DoxygenToolkit.vim</a></td>
+ <td class="roweven" valign="top" nowrap><b>0.2.8</b></td>
+ <td class="roweven" valign="top" nowrap><i>2010-08-06</i></td>
+ <td class="roweven" valign="top" nowrap>7.0</td>
+ <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=5172">Mathias Lorente</a></i></td>
+ <td class="roweven" valign="top" width="2000">Add support for documentation of template parameters.
<br>(Thanks to Dennis)</td>
+</tr>
+<tr>
<td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=11878">DoxygenToolkit.vim</a></td>
<td class="rowodd" valign="top" nowrap><b>0.2.7</b></td>
<td class="rowodd" valign="top" nowrap><i>2009-12-06</i></td>
diff --git a/plugin/DoxygenToolkit.vim b/plugin/DoxygenToolkit.vim
index f5159d5..37d51a6 100644
--- a/plugin/DoxygenToolkit.vim
+++ b/plugin/DoxygenToolkit.vim
@@ -1,13 +1,46 @@
" DoxygenToolkit.vim
" Brief: Usefull tools for Doxygen (comment, author, license).
-" Version: 0.2.7
-" Date: 12/06/09
+" Version: 0.2.13
+" Date: 2010/10/16
" Author: Mathias Lorente
"
" TODO: add automatically (option controlled) in/in out flags to function
" parameters
" TODO: (Python) Check default paramareters defined as list/dictionnary/tuple
"
+" Note: Correct insertion position and 'xxx_post' parameters.
+" - Insert position is correct when g:DoxygenToolkit_compactOneLineDoc = "yes"
+" and let g:DoxygenToolkit_commentType = "C++" are set.
+" - When you define:
+" g:DoxygenToolkit_briefTag_pre = "@brief "
+" g:DoxygenToolkit_briefTag_post = "<++>"
+" g:DoxygenToolkit_briefTag_funcName = "yes"
+" Documentation generated with these parameters is something like:
+" /// @brief foo <++>
+" You can configure similarly parameters to get something like:
+" /// @brief foo <++>
+" /// @param bar <++>
+" /// @param baz <++>
+"
+" Note: Position the cursor at the right position for one line documentation.
+"
+" Note: Remove trailing blank characters where they are not needed.
+"
+" Note: 'extern' keyword added in list of values to ignore for return type.
+"
+" Note: Correct bugs related to templates and add support for throw statement
+" (many thanks to Dennis Lubert):
+" - Template parameter of different type from class and typename are
+" recognized.
+" - Indentation mistake while detecting template.
+" - New option are available: g:DoxygenToolkit_throwTag_pre and
+" g:DoxygenToolkit_throwTag_post
+"
+" Note: Add support for documentation of template parameters.
+" Thanks to Dennis (plasmahh) and its suggestions.
+" - New option are available: g:DoxygenToolkit_templateParamTag_pre
+" and g:DoxygenToolkit_templateParamTag_post
+"
" Note: Solve almost all compatibility problem with c/c++ IDE
"
" Note: Bug correction and improve compatibility with c/c++ IDE
@@ -227,8 +260,8 @@
" Verify if already loaded
"if exists("loaded_DoxygenToolkit")
-" echo 'DoxygenToolkit Already Loaded.'
-" finish
+" echo 'DoxygenToolkit Already Loaded.'
+" finish
"endif
let loaded_DoxygenToolkit = 1
"echo 'Loading DoxygenToolkit...'
@@ -252,6 +285,12 @@ endif
if !exists("g:DoxygenToolkit_briefTag_post")
let g:DoxygenToolkit_briefTag_post = ""
endif
+if !exists("g:DoxygenToolkit_templateParamTag_pre")
+ let g:DoxygenToolkit_templateParamTag_pre = "@tparam "
+endif
+if !exists("g:DoxygenToolkit_templateParamTag_post")
+ let g:DoxygenToolkit_templateParamTag_post = ""
+endif
if !exists("g:DoxygenToolkit_paramTag_pre")
let g:DoxygenToolkit_paramTag_pre = "@param "
endif
@@ -261,6 +300,12 @@ endif
if !exists("g:DoxygenToolkit_returnTag")
let g:DoxygenToolkit_returnTag = "@return "
endif
+if !exists("g:DoxygenToolkit_throwTag_pre")
+ let g:DoxygenToolkit_throwTag_pre = "@throw " " @exception is also valid
+endif
+if !exists("g:DoxygenToolkit_throwTag_post")
+ let g:DoxygenToolkit_throwTag_post = ""
+endif
if !exists("g:DoxygenToolkit_blockHeader")
let g:DoxygenToolkit_blockHeader = ""
endif
@@ -343,7 +388,7 @@ if !exists("g:DoxygenToolkit_compactDoc")
endif
" Necessary '\<' and '\>' will be added to each item of the list.
-let s:ignoreForReturn = ['template', 'explicit', 'inline', 'static', 'virtual', 'void\([[:blank:]]*\*\)\@!', 'const', 'volatile', 'struct']
+let s:ignoreForReturn = ['template', 'explicit', 'inline', 'static', 'virtual', 'void\([[:blank:]]*\*\)\@!', 'const', 'volatile', 'struct', 'extern']
if !exists("g:DoxygenToolkit_ignoreForReturn")
let g:DoxygenToolkit_ignoreForReturn = s:ignoreForReturn[:]
else
@@ -517,6 +562,7 @@ function! <SID>DoxygenCommentFunc()
let l:endDocPattern = ';\|{\|\%([^:]\zs:\ze\%([^:]\|$\)\)'
let l:commentPattern = '\%(/*\)\|\%(//\)\'
let l:templateParameterPattern = "<[^<>]*>"
+ let l:throwPattern = '.*\<throw\>[[:blank:]]*(\([^()]*\)).*' "available only for 'cpp' type
let l:classPattern = '\<class\>[[:blank:]]\+\zs'.l:someNameWithNamespacePattern.'\ze.*\%('.l:endDocPattern.'\)'
let l:structPattern = '\<struct\>[[:blank:]]\+\zs'.l:someNameWithNamespacePattern.'\ze[^(),]*\%('.l:endDocPattern.'\)'
@@ -539,7 +585,7 @@ function! <SID>DoxygenCommentFunc()
let l:count = 1
let l:endDocFound = 0
- let l:doc = { "type": "", "name": "None", "params": [], "returns": "" }
+ let l:doc = { "type": "", "name": "None", "params": [], "returns": "" , "templates": [], "throws": [] }
" Mark current line for future use
mark d
@@ -566,13 +612,28 @@ function! <SID>DoxygenCommentFunc()
" Look for the end of the function/class/... to document
" TODO does not work when function/class/... is commented out!
+ let l:readError = "Cannot reach end of function/class/... declaration!"
let l:count = 0
+ let l:throwCompleted = 0
+ let l:endReadPattern = l:endDocPattern
while( l:endDocFound == 0 && l:count < g:DoxygenToolkit_maxFunctionProtoLines )
let l:lineBuffer = s:RemoveComments( l:lineBuffer )
" Valid only for cpp. For Python it must be 'class ...:' or 'def ...:' or
" '... EOL'.
- if( match( l:lineBuffer, l:endDocPattern ) != -1 )
- let l:endDocFound = 1
+ if( match( l:lineBuffer, l:endReadPattern ) != -1 )
+ " Look for throw statement at the end
+ if( s:CheckFileType() == "cpp" && l:throwCompleted == 0 )
+ " throw statement can have already been read or can be on next line
+ if( match( l:lineBuffer.' '.getline( line ( "." ) + 1 ), '.*\<throw\>.*' ) != -1 )
+ let l:endReadPattern = l:throwPattern
+ let l:throwCompleted = 1
+ let l:readError = "Cannot reach end of throw statement"
+ else
+ let l:endDocFound = 1
+ endif
+ else
+ let l:endDocFound = 1
+ endif
continue
endif
exec "normal j"
@@ -585,7 +646,7 @@ function! <SID>DoxygenCommentFunc()
" Fall here when only comments have been found.
call s:WarnMsg( "Nothing to document here!" )
else
- call s:WarnMsg( "Cannot reach end of function/class/... declaration!" )
+ call s:WarnMsg( l:readError )
endif
exec "normal `d"
return
@@ -594,6 +655,8 @@ function! <SID>DoxygenCommentFunc()
" Trim the buffer
let l:lineBuffer = substitute( l:lineBuffer, "^[[:blank:]]*\|[[:blank:]]*$", "", "g" )
+ " Check whether it is a template definition
+ call s:ParseFunctionTemplateParameters( l:lineBuffer, l:doc )
" Remove any template parameter.
if( s:CheckFileType() == "cpp" )
while( match( l:lineBuffer, l:templateParameterPattern ) != -1 )
@@ -637,6 +700,9 @@ function! <SID>DoxygenCommentFunc()
else
let l:doc.type = 'function'
call s:ParseFunctionParameters( l:lineBuffer, l:doc )
+ if( l:throwCompleted == 1 )
+ call s:ParseThrowParameters( l:lineBuffer, l:doc, l:throwPattern )
+ endif
endif
" This is an attribute for Python
@@ -673,17 +739,17 @@ function! <SID>DoxygenCommentFunc()
" Brief
if( g:DoxygenToolkit_compactOneLineDoc =~ "yes" && l:doc.returns != "yes" && len( l:doc.params ) == 0 )
let s:compactOneLineDoc = "yes"
- "exec "normal O".s:startCommentTag.g:DoxygenToolkit_briefTag_pre.g:DoxygenToolkit_briefTag_post
exec "normal O".strpart( s:startCommentTag, 0, 1 )
- exec "normal A".strpart( s:startCommentTag, 1 ).g:DoxygenToolkit_briefTag_pre.g:DoxygenToolkit_briefTag_post
+ exec "normal A".strpart( s:startCommentTag, 1 ).g:DoxygenToolkit_briefTag_pre
else
let s:compactOneLineDoc = "no"
let l:insertionMode = s:StartDocumentationBlock()
- exec "normal ".l:insertionMode.s:interCommentTag.g:DoxygenToolkit_briefTag_pre.g:DoxygenToolkit_briefTag_post
+ exec "normal ".l:insertionMode.s:interCommentTag.g:DoxygenToolkit_briefTag_pre
endif
if( l:doc.name != "None" )
exec "normal A".l:doc.name." "
endif
+ exec "normal A".g:DoxygenToolkit_briefTag_post
" Mark the line where the cursor will be positionned.
mark d
@@ -694,26 +760,51 @@ function! <SID>DoxygenCommentFunc()
else
let s:insertEmptyLine = 1
endif
+ for param in l:doc.templates
+ if( s:insertEmptyLine == 1 )
+ exec "normal o".substitute( s:interCommentTag, "[[:blank:]]*$", "", "" )
+ let s:insertEmptyLine = 0
+ endif
+ exec "normal o".s:interCommentTag.g:DoxygenToolkit_templateParamTag_pre.param.g:DoxygenToolkit_templateParamTag_post
+ endfor
for param in l:doc.params
if( s:insertEmptyLine == 1 )
- exec "normal o".s:interCommentTag
+ exec "normal o".substitute( s:interCommentTag, "[[:blank:]]*$", "", "" )
let s:insertEmptyLine = 0
endif
- exec "normal o".s:interCommentTag.g:DoxygenToolkit_paramTag_pre.g:DoxygenToolkit_paramTag_post.param
+ exec "normal o".s:interCommentTag.g:DoxygenToolkit_paramTag_pre.param.g:DoxygenToolkit_paramTag_post
endfor
" Returned value
if( l:doc.returns == "yes" )
if( g:DoxygenToolkit_compactDoc != "yes" )
- exec "normal o".s:interCommentTag
+ exec "normal o".substitute( s:interCommentTag, "[[:blank:]]*$", "", "" )
endif
exec "normal o".s:interCommentTag.g:DoxygenToolkit_returnTag
endif
+ " Exception (throw) values (cpp only)
+ if( len( l:doc.throws ) > 0 )
+ if( g:DoxygenToolkit_compactDoc =~ "yes" )
+ let s:insertEmptyLine = 0
+ else
+ let s:insertEmptyLine = 1
+ endif
+ for param in l:doc.throws
+ if( s:insertEmptyLine == 1 )
+ exec "normal o".substitute( s:interCommentTag, "[[:blank:]]*$", "", "" )
+ let s:insertEmptyLine = 0
+ endif
+ exec "normal o".s:interCommentTag.g:DoxygenToolkit_throwTag_pre.param.g:DoxygenToolkit_throwTag_post
+ endfor
+ endif
+
" End (if any) of documentation block.
if( s:endCommentTag != "" )
if( s:compactOneLineDoc =~ "yes" )
- let s:execCommand = "A "
+ let s:execCommand = "A"
+ exec "normal A "
+ exec "normal $md"
else
let s:execCommand = "o"
endif
@@ -728,7 +819,11 @@ function! <SID>DoxygenCommentFunc()
exec "normal `d"
call s:RestoreParameters()
- startinsert!
+ if( s:compactOneLineDoc =~ "yes" && s:endCommentTag != "" )
+ startinsert
+ else
+ startinsert!
+ endif
" DEBUG purpose only
"call s:WarnMsg( "Found a ".l:doc.type." named ".l:doc.name." (env: ".s:CheckFileType().")." )
@@ -760,7 +855,7 @@ function! s:StartDocumentationBlock()
if( s:startCommentTag != s:interCommentTag )
"exec "normal O".s:startCommentTag
exec "normal O".strpart( s:startCommentTag, 0, 1 )
- exec "normal A".strpart( s:startCommentTag, 1 )
+ exec "normal A".substitute( strpart( s:startCommentTag, 1 ), "[[:blank:]]*$", "", "" )
let l:insertionMode = "o"
else
let l:insertionMode = "O"
@@ -825,6 +920,7 @@ function! s:ParseFunctionParameters( lineBuffer, doc )
" all the function definition to know whether a value is returned or not.
if( s:CheckFileType() == "cpp" )
let l:functionBuffer = strpart( a:lineBuffer, 0, l:paramPosition )
+ " Remove unnecessary elements
for ignored in g:DoxygenToolkit_ignoreForReturn
let l:functionBuffer = substitute( l:functionBuffer, '\<'.ignored.'\>', '', 'g' )
endfor
@@ -839,7 +935,7 @@ function! s:ParseFunctionParameters( lineBuffer, doc )
let l:parametersBuffer = strpart( a:lineBuffer, l:paramPosition + 1 )
" Remove trailing closing bracket and everything that follows and trim.
if( s:CheckFileType() == "cpp" )
- let l:parametersBuffer = substitute( l:parametersBuffer, ')[^)]*\%(;\|{\|\%([^:]:\%([^:]\|$\)\)\).*', '', '' )
+ let l:parametersBuffer = substitute( l:parametersBuffer, ')[^)]*\%(;\|{\|\%([^:]:\%([^:]\|$\)\)\|\%(\<throw\>\)\).*', '', '' )
else
let l:parametersBuffer = substitute( l:parametersBuffer, ')[^)]*:.*', '', '' )
endif
@@ -941,6 +1037,38 @@ function! s:ParseParameter( param )
return l:paramName
endfunction
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Extract template parameter name for function/class/method
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! s:ParseFunctionTemplateParameters( lineBuffer, doc )
+ if( match( a:lineBuffer, '^[[:blank:]]*template' ) == 0 )
+ let l:firstIndex = stridx( a:lineBuffer, '<' )
+ if( l:firstIndex != -1 )
+ let l:lastIndex = stridx( a:lineBuffer, '>', l:firstIndex + 1 )
+ if( l:lastIndex != -1 )
+ " Keep only template parameters
+ let l:parameters = strpart( a:lineBuffer, l:firstIndex + 1, l:lastIndex - l:firstIndex - 1)
+ " Split on separator (,)
+ let l:params = split( l:parameters, '\,' )
+ for param in l:params
+ " Extract template parameter name
+ let l:paramName = split( split( param, '=' )[0], '[[:blank:]]' )[-1]
+ call add( a:doc.templates, l:paramName )
+ endfor
+ endif
+ endif
+ endif
+endfunction
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Extract throw parameter name
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! s:ParseThrowParameters( lineBuffer, doc, throwPattern )
+ let l:throwParams = substitute( a:lineBuffer, a:throwPattern, '\1', "" )
+ for param in split( l:throwParams, "," )
+ call add( a:doc.throws, substitute( param, '[[:blank:]]', '', "" ) )
+ endfor
+endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Define start/end documentation format and backup generic parameters.
--
vim-scripts packaging
More information about the pkg-vim-maintainers
mailing list