Skip to content

Hook arg matchstr is incorrectly reversed #47

@davidosomething

Description

@davidosomething

See

let l:matchedArg = matchstr(a:hook, a:arg)

function! s:hookArgs(lines, space, arg, hook, argType, argDescription)
  " Hook function signature's args for insert as default value.
  if g:jsdoc_custom_args_hook == {}
    call add(a:lines, a:space . ' * @' . g:jsdoc_tags['param'] . ' ' . a:arg)
  else
    let l:matchedArg = matchstr(a:hook, a:arg)

The call to matchstr is called with the first arg being the hook, the second arg as the function parameter

so for the javascript

function myf(isBoolean) {
}

it is run against:

matchstr(regexPattern, 'isBoolean')

According to the vim docs, matchstr should be called:

match("testing", "ing")

That is, match('isBoolean', regexPattern)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions