Closed thedaniel closed 8 years ago
Actually, this regex might not be quite right since it needs to support default parameters as well. will update...
:heart:
Sounds like a good idea to me :+1:
:+1:
I changed the second character class in the function parameter capture group to .+
because writing a giant highly specific character class seems unnecessary given how specific the rest of the regex is. It now matches all of the following strings:
async connectedToDB () {
async request (requestPath, _fetchOptions = {}, _options = {}) {
async write (key, record, timestamp) {
I'd love to hear why I shouldn't be using the bludgeon that is .+
because while my regex is strong it is not kung fu master level, but so far this ctags-config is working for me on a babelized js project.
I'd love to hear why I shouldn't be using the bludgeon that is
.+
I don't think it would be a big problem. Is there a reason you chose something other than the \([^)]*\)
pattern for the parameter list like in the function version a couple lines previous?
Side note – it's a bit of a bummer that we can't reuse tokenization from the language-
packages for generating symbols. :disappointed:
@lee-dohm we shouldn't omit )
because we can supply a function call as a default param (i doubt this is common, but it does transpile successfully in babel so...)
cf:
class Foo {
async functionWithFunctionCallAsDefaultParam (foo, bar = baz()) {
}
}
@thedaniel Whoa, can you stick any expression in a default param?
Ah interesting. Thanks for clarifying @thedaniel :grinning:
merging, i really think .+
is fine but we can write out a large specific character class if we hit any bugs.
@atom/feedback ...any reason not to add these to the symbols-view? I've been writing a lot of babelized classes with async/await lately and this definitely makes my life better.