-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
133 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
" ============================================================================== | ||
" The R documentation should follow the 'Roxygen2' conventions. | ||
" see https://github.com/klutometis/roxygen | ||
" ============================================================================== | ||
|
||
let s:save_cpo = &cpoptions | ||
set cpoptions&vim | ||
|
||
let b:doge_pattern_single_line_comment = '\m#.\{-}$' | ||
let b:doge_pattern_multi_line_comment = '\m#.\{-}$' | ||
|
||
let b:doge_supported_doc_standards = ['google'] | ||
let b:doge_doc_standard = get(g:, 'doge_doc_standard_sh', b:doge_supported_doc_standards[0]) | ||
if index(b:doge_supported_doc_standards, b:doge_doc_standard) < 0 | ||
echoerr printf( | ||
\ '[DoGe] %s is not a valid Shell doc standard, available doc standard are: %s', | ||
\ b:doge_doc_standard, | ||
\ join(b:doge_supported_doc_standards, ', ') | ||
\ ) | ||
endif | ||
|
||
let b:doge_patterns = [] | ||
|
||
" ============================================================================== | ||
" Matches regular functions. | ||
" ============================================================================== | ||
" | ||
" Matches the following scenarios: | ||
" | ||
" function test {} | ||
" | ||
" test() {} | ||
call add(b:doge_patterns, { | ||
\ 'match': '\m^\(function\s\+[[:alnum:]_-]\+\|[[:alnum:]_-]\+\s*(.\{-})\)\s*{', | ||
\ 'match_group_names': [], | ||
\ 'comment': { | ||
\ 'insert': 'above', | ||
\ 'template': { | ||
\ 'google': [ | ||
\ '################################################################################', | ||
\ '# !description', | ||
\ '# Globals:', | ||
\ '# \t!var-name', | ||
\ '# Arguments:', | ||
\ '# \t$1: !description', | ||
\ '# Returns:', | ||
\ '# \t!description', | ||
\ '################################################################################', | ||
\ ], | ||
\ }, | ||
\ }, | ||
\}) | ||
|
||
let &cpoptions = s:save_cpo | ||
unlet s:save_cpo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
################################################################################ | ||
# [TODO:description] | ||
# Globals: | ||
# [TODO:var-name] | ||
# Arguments: | ||
# $1: [TODO:description] | ||
# Returns: | ||
# [TODO:description] | ||
################################################################################ | ||
function test { | ||
print "foobar" | ||
} | ||
|
||
################################################################################ | ||
# [TODO:description] | ||
# Globals: | ||
# [TODO:var-name] | ||
# Arguments: | ||
# $1: [TODO:description] | ||
# Returns: | ||
# [TODO:description] | ||
################################################################################ | ||
test() { | ||
print "foobar" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# ============================================================================== | ||
# Regular functions. | ||
# ============================================================================== | ||
Given sh (regular functions): | ||
function test { | ||
print "foobar" | ||
} | ||
|
||
test() { | ||
print "foobar" | ||
} | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
:14\<CR> | ||
\<C-d> | ||
|
||
Expect sh (generated comments with a descriptios and 'Globals', 'Arguments' and 'Returns' keywords): | ||
################################################################################ | ||
# [TODO:description] | ||
# Globals: | ||
# [TODO:var-name] | ||
# Arguments: | ||
# $1: [TODO:description] | ||
# Returns: | ||
# [TODO:description] | ||
################################################################################ | ||
function test { | ||
print "foobar" | ||
} | ||
|
||
################################################################################ | ||
# [TODO:description] | ||
# Globals: | ||
# [TODO:var-name] | ||
# Arguments: | ||
# $1: [TODO:description] | ||
# Returns: | ||
# [TODO:description] | ||
################################################################################ | ||
test() { | ||
print "foobar" | ||
} |