ctags-patterns-for-javascript icon indicating copy to clipboard operation
ctags-patterns-for-javascript copied to clipboard

not picking up method signatures that span multiple lines

Open dyllandry opened this issue 4 years ago • 1 comments

This works:

  extractEmailsFromString(text, options = { isWrappedLessThanGreaterThan: false, }) {
    if (options.isWrappedLessThanGreaterThan) {
      return text.match(/(<[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+>)/gi);
    }
    return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
  }

But this doesn't work:

  extractEmailsFromString(text, options = {
    isWrappedLessThanGreaterThan: false,
  }) {
    if (options.isWrappedLessThanGreaterThan) {
      return text.match(/(<[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+>)/gi);
    }
    return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
  }

I know ctags works on a line by line basis, so is this just not possible to implement? Thanks for making this project!

dyllandry avatar Apr 06 '21 16:04 dyllandry

Yeah, in cases where there is no function or : or = I need to be sure that this is a definition and not a call and for that I must find the ) {.

I don't think I've ever tried to use \n in this context but I can see this becoming very complicated very quickly. I will see what I can do.

romainl avatar Apr 06 '21 17:04 romainl