From 9522f3e903bb8c0f1590fde40eece462e234c955 Mon Sep 17 00:00:00 2001 From: Kim K Date: Thu, 30 May 2019 10:42:04 +0200 Subject: [PATCH] feat: Adjust indentation for b:doge_pattern items --- ftplugin/coffee.vim | 40 +++++++-------- ftplugin/java.vim | 38 +++++++------- ftplugin/javascript.vim | 108 ++++++++++++++++++++-------------------- ftplugin/jsx.vim | 108 ++++++++++++++++++++-------------------- ftplugin/lua.vim | 64 ++++++++++++------------ ftplugin/php.vim | 38 +++++++------- ftplugin/python.vim | 40 +++++++-------- ftplugin/ruby.vim | 32 ++++++------ ftplugin/tsx.vim | 108 ++++++++++++++++++++-------------------- ftplugin/typescript.vim | 108 ++++++++++++++++++++-------------------- 10 files changed, 342 insertions(+), 342 deletions(-) diff --git a/ftplugin/coffee.vim b/ftplugin/coffee.vim index 2f675f7e..eade5783 100644 --- a/ftplugin/coffee.vim +++ b/ftplugin/coffee.vim @@ -110,26 +110,26 @@ let b:doge_patterns = [] " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\([[:alnum:]_$]\+\)\%(<[[:alnum:][:space:]_,]*>\)\?\s*[:=]\?\s*(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*->', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '###', - \ '@function {funcName|}', - \ '@description TODO', - \ '{parameters}', - \ '!@return {{returnType}} TODO', - \ '###', - \ ], - \ }, - \ }) +\ 'match': '\m^\([[:alnum:]_$]\+\)\%(<[[:alnum:][:space:]_,]*>\)\?\s*[:=]\?\s*(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*->', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '###', +\ '@function {funcName|}', +\ '@description TODO', +\ '{parameters}', +\ '!@return {{returnType}} TODO', +\ '###', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/java.vim b/ftplugin/java.vim index 01be7f88..9fdd1089 100644 --- a/ftplugin/java.vim +++ b/ftplugin/java.vim @@ -96,25 +96,25 @@ let b:doge_patterns = [] " Matches a captured group, denoted as '\( ... \)', which may contain 1 or " more of the following characters '[[:alnum:]_]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(public\|private\|protected\)\?\s*\%(static\)\?\s*\%(final\)\?\s*\%(\([[:alnum:]_]\+\)\%(<[[:alnum:][:space:]_,]*>\)\?\)\s*\([[:alnum:]_]\+\)\s*(\(.\{-}\))\s*{', - \ 'match_group_names': ['returnType', 'funcName', 'parameters'], - \ 'parameters': { - \ 'match': '\m\%(\([[:alnum:]_]\+\)\%(<[[:alnum:][:space:]_,]\+>\)\?\)\%(\s\+[.]\{3}\s\+\|\s\+[.]\{3}\|[.]\{3}\s\+\|\s\+\)\([[:alnum:]_]\+\)', - \ 'match_group_names': ['type', 'name'], - \ 'format': ['@param', '{type}', '{name}', 'TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * TODO', - \ ' * {parameters}', - \ '! * @return {returnType} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(public\|private\|protected\)\?\s*\%(static\)\?\s*\%(final\)\?\s*\%(\([[:alnum:]_]\+\)\%(<[[:alnum:][:space:]_,]*>\)\?\)\s*\([[:alnum:]_]\+\)\s*(\(.\{-}\))\s*{', +\ 'match_group_names': ['returnType', 'funcName', 'parameters'], +\ 'parameters': { +\ 'match': '\m\%(\([[:alnum:]_]\+\)\%(<[[:alnum:][:space:]_,]\+>\)\?\)\%(\s\+[.]\{3}\s\+\|\s\+[.]\{3}\|[.]\{3}\s\+\|\s\+\)\([[:alnum:]_]\+\)', +\ 'match_group_names': ['type', 'name'], +\ 'format': ['@param', '{type}', '{name}', 'TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * TODO', +\ ' * {parameters}', +\ '! * @return {returnType} TODO', +\ ' */', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim index fb83f730..684cce1d 100644 --- a/ftplugin/javascript.vim +++ b/ftplugin/javascript.vim @@ -56,20 +56,20 @@ let b:doge_patterns = [] " -------------------------------------------------------------------------- " Matches 0 or more spaces, followed by the character '{'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', - \ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * TODO', - \ '! * @extends {parentClassName}', - \ '! * @implements {interfaceName}', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', +\ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * TODO', +\ '! * @extends {parentClassName}', +\ '! * @implements {interfaceName}', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -175,26 +175,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -312,26 +312,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/jsx.vim b/ftplugin/jsx.vim index 71cd2f36..617d1b4f 100644 --- a/ftplugin/jsx.vim +++ b/ftplugin/jsx.vim @@ -58,20 +58,20 @@ let b:doge_patterns = [] " -------------------------------------------------------------------------- " Matches 0 or more spaces, followed by the character '{'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', - \ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * TODO', - \ '! * @extends {parentClassName}', - \ '! * @implements {interfaceName}', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', +\ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * TODO', +\ '! * @extends {parentClassName}', +\ '! * @implements {interfaceName}', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -177,26 +177,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -314,26 +314,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/lua.vim b/ftplugin/lua.vim index 6450262b..572de16b 100644 --- a/ftplugin/lua.vim +++ b/ftplugin/lua.vim @@ -58,22 +58,22 @@ let b:doge_patterns = [] " Matches a captured group that may contain 1 or more of the following " characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(local\s*\)\?function\s*\%([[:alnum:]_:.]\+[:.]\)\?\([[:alnum:]_]\+\)\s*(\(.\{-}\))', - \ 'match_group_names': ['funcName', 'parameters'], - \ 'parameters': { - \ 'match': '\m\([^,]\+\)', - \ 'match_group_names': ['name'], - \ 'format': ['@param', '{name}', 'TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '-- TODO', - \ '-- {parameters}', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(local\s*\)\?function\s*\%([[:alnum:]_:.]\+[:.]\)\?\([[:alnum:]_]\+\)\s*(\(.\{-}\))', +\ 'match_group_names': ['funcName', 'parameters'], +\ 'parameters': { +\ 'match': '\m\([^,]\+\)', +\ 'match_group_names': ['name'], +\ 'format': ['@param', '{name}', 'TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '-- TODO', +\ '-- {parameters}', +\ ], +\ }, +\}) "" " ============================================================================== @@ -125,22 +125,22 @@ call add(b:doge_patterns, { " Matches a captured group that may contain 1 or more of the following " characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(local\s*\)\?\%([[:alnum:]_:.]\+[:.]\)\?\([[:alnum:]_]\+\)\s*=\s*\%(\s*function\s*\)\?(\(.\{-}\))', - \ 'match_group_names': ['funcName', 'parameters'], - \ 'parameters': { - \ 'match': '\m\([^,]\+\)', - \ 'match_group_names': ['name'], - \ 'format': ['@param', '{name}', 'TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '-- TODO', - \ '-- {parameters}', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(local\s*\)\?\%([[:alnum:]_:.]\+[:.]\)\?\([[:alnum:]_]\+\)\s*=\s*\%(\s*function\s*\)\?(\(.\{-}\))', +\ 'match_group_names': ['funcName', 'parameters'], +\ 'parameters': { +\ 'match': '\m\([^,]\+\)', +\ 'match_group_names': ['name'], +\ 'format': ['@param', '{name}', 'TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '-- TODO', +\ '-- {parameters}', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/php.vim b/ftplugin/php.vim index f5bda1a5..58d6d11c 100644 --- a/ftplugin/php.vim +++ b/ftplugin/php.vim @@ -83,25 +83,25 @@ let b:doge_patterns = [] " be '[]' or 'array()' rather then 'array(1, 2, 3, ...)', otherwise '[^,]' " will not work. call add(b:doge_patterns, { - \ 'match': '\m^\%(public\|private\|protected\)\?\s*\%(static\)\?\s*\%(final\)\?\s*function\s*\([^(]\+\)\s*(\(.\{-}\))\s*{', - \ 'match_group_names': ['funcName', 'parameters'], - \ 'parameters': { - \ 'match': '\m\([[:alnum:]_\\]\+\)\?\s*&\?\($[[:alnum:]_]\+\)\%(\s*=\s*[^,]\+\)\?', - \ 'match_group_names': ['type', 'name'], - \ 'format': ['@param {type|mixed} {name} TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * TODO', - \ ' *', - \ ' * {parameters}', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(public\|private\|protected\)\?\s*\%(static\)\?\s*\%(final\)\?\s*function\s*\([^(]\+\)\s*(\(.\{-}\))\s*{', +\ 'match_group_names': ['funcName', 'parameters'], +\ 'parameters': { +\ 'match': '\m\([[:alnum:]_\\]\+\)\?\s*&\?\($[[:alnum:]_]\+\)\%(\s*=\s*[^,]\+\)\?', +\ 'match_group_names': ['type', 'name'], +\ 'format': ['@param {type|mixed} {name} TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * TODO', +\ ' *', +\ ' * {parameters}', +\ ' */', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/python.vim b/ftplugin/python.vim index 668c8927..c675ca9b 100644 --- a/ftplugin/python.vim +++ b/ftplugin/python.vim @@ -78,26 +78,26 @@ let b:doge_patterns = [] " which may contain the pattern ' = '. The '' should contain " 1 or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^def \([^(]\+\)\s*(\(.\{-}\))\%(\s*->\s*\(.\{-}\)\)\?\s*:', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\([[:alnum:]_]\+\)\%(:\s*\([[:alnum:]_]\+\%(\[[[:alnum:]_[\],[:space:]]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': [':param', '{name}', '{type|any}:', 'TODO'], - \ }, - \ 'comment': { - \ 'insert': 'below', - \ 'trim_comparision_check': 1, - \ 'template': [ - \ '"""', - \ 'TODO', - \ '', - \ '{parameters}', - \ '!:rtype {returnType}: TODO', - \ '"""', - \ ], - \ }, - \ }) +\ 'match': '\m^def \([^(]\+\)\s*(\(.\{-}\))\%(\s*->\s*\(.\{-}\)\)\?\s*:', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\([[:alnum:]_]\+\)\%(:\s*\([[:alnum:]_]\+\%(\[[[:alnum:]_[\],[:space:]]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': [':param', '{name}', '{type|any}:', 'TODO'], +\ }, +\ 'comment': { +\ 'insert': 'below', +\ 'trim_comparision_check': 1, +\ 'template': [ +\ '"""', +\ 'TODO', +\ '', +\ '{parameters}', +\ '!:rtype {returnType}: TODO', +\ '"""', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index fb9891e5..9e8bffc1 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -53,22 +53,22 @@ let b:doge_patterns = [] " should contain the pattern ' = ' where '' may contain 1 or " more of the following characters '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^def\s\+\([^=(!]\+\)[=!]\?\s*(\(.\{-}\))', - \ 'match_group_names': ['funcName', 'parameters'], - \ 'parameters': { - \ 'match': '\m\([[:alnum:]_]\+\)\%(\s*=\s*[^,]\+\)\?', - \ 'match_group_names': ['name'], - \ 'format': ['@param {name} [type] TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '# TODO', - \ '# {parameters}', - \ ], - \ }, - \ }) +\ 'match': '\m^def\s\+\([^=(!]\+\)[=!]\?\s*(\(.\{-}\))', +\ 'match_group_names': ['funcName', 'parameters'], +\ 'parameters': { +\ 'match': '\m\([[:alnum:]_]\+\)\%(\s*=\s*[^,]\+\)\?', +\ 'match_group_names': ['name'], +\ 'format': ['@param {name} [type] TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '# TODO', +\ '# {parameters}', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/tsx.vim b/ftplugin/tsx.vim index a81fab22..6317a1e2 100644 --- a/ftplugin/tsx.vim +++ b/ftplugin/tsx.vim @@ -60,20 +60,20 @@ let b:doge_patterns = [] " -------------------------------------------------------------------------- " Matches 0 or more spaces, followed by the character '{'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', - \ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * TODO', - \ '! * @extends {parentClassName}', - \ '! * @implements {interfaceName}', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', +\ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * TODO', +\ '! * @extends {parentClassName}', +\ '! * @implements {interfaceName}', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -179,26 +179,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -316,26 +316,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/typescript.vim b/ftplugin/typescript.vim index c7f0e9d8..76d2de26 100644 --- a/ftplugin/typescript.vim +++ b/ftplugin/typescript.vim @@ -60,20 +60,20 @@ let b:doge_patterns = [] " -------------------------------------------------------------------------- " Matches 0 or more spaces, followed by the character '{'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', - \ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * TODO', - \ '! * @extends {parentClassName}', - \ '! * @implements {interfaceName}', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s*\)\?class\s\+\([[:alnum:]_$]\+\)\%(\s\+extends\s\+\([[:alnum:]_$]\+\)\)\?\%(\s\+implements\s\+\([[:alnum:]_$]\+\)\)\?\s*{', +\ 'match_group_names': ['className', 'parentClassName', 'interfaceName'], +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * TODO', +\ '! * @extends {parentClassName}', +\ '! * @implements {interfaceName}', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -179,26 +179,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(\%(\%(var\|const\|let\)\s\+\)\?\([[:alnum:]_$]\+\)\s*=\s*\)\?({\?\([^>]\{-}\)}\?)\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*=>\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\?\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) "" " ============================================================================== @@ -316,26 +316,26 @@ call add(b:doge_patterns, { " The group for the default value is a capturing group which may contain 1 " or more of the following characters: '[^,]'. call add(b:doge_patterns, { - \ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', - \ 'match_group_names': ['funcName', 'parameters', 'returnType'], - \ 'parameters': { - \ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', - \ 'match_group_names': ['name', 'type', 'default'], - \ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], - \ }, - \ 'comment': { - \ 'insert': 'above', - \ 'trim_comparision_check': 0, - \ 'template': [ - \ '/**', - \ ' * @function {funcName|}', - \ ' * @description TODO', - \ ' * {parameters}', - \ '! * @return {{returnType}} TODO', - \ ' */', - \ ], - \ }, - \ }) +\ 'match': '\m^\%(export\s\+\)\?\%(function\s*\)\?\([[:alnum:]_$]\+\)\?\%(<[[:alnum:][:space:]_,]*>\)\?(\([^>]\{-}\))\%(\s*:\s*(\?\([[:alnum:][:space:]_[\].,|<>]\+\))\?\)\?\s*[{(]', +\ 'match_group_names': ['funcName', 'parameters', 'returnType'], +\ 'parameters': { +\ 'match': '\m\%(\%(public\|private\|protected\)\?\s*\)\([[:alnum:]_$]\+\)\%(\s*:\s*\([[:alnum:][:space:]._|]\+\%(\[[[:alnum:][:space:]_[\],]*\]\)\?\)\)\?\%(\s*=\s*\([^,]\+\)\+\)\?', +\ 'match_group_names': ['name', 'type', 'default'], +\ 'format': ['@param', '!{{type|*}}', '{name}', '- TODO'], +\ }, +\ 'comment': { +\ 'insert': 'above', +\ 'trim_comparision_check': 0, +\ 'template': [ +\ '/**', +\ ' * @function {funcName|}', +\ ' * @description TODO', +\ ' * {parameters}', +\ '! * @return {{returnType}} TODO', +\ ' */', +\ ], +\ }, +\}) let &cpoptions = s:save_cpo unlet s:save_cpo