Export Class Support
I'm pretty unfamiliar with the syntax for ctags regex and was wondering if there's a reason that the following wouldn't work?
export class Foo {
// ...
}
I'd expect to be able to reach Foo as a class if that makes sense.
The pattern for the Class kind assumes this structure:
[BOL][0+ whitespace][class][1+ whitespace][name]
You would need to add another pattern for that one:
[BOL][0+ whitespace][export][1+ whitespace][class][1+ whitespace][name]
But I'm conflicted about this request as Foo would be both a named export and a class.
Hm, yeah I see get the conflict. Is that just a semantic difference in ctags or is it more meaningful?
For the pattern, would this make sense?
--regex-javascript=/^[ \t]export[ \t]*class[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/C,Class,Classes/b
I just added export[ \t] in front of *class...
This is better:
--regex-javascript=/^[ \t]*export[ \t]\{1,\}class[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/C,Class,Classes/b
This is not a technical problem, really, but a semantic problem: is that a named export or class definition?
Makes sense, thanks! And it’s really both. I have a single file with a single class definition that it exports as a named export (i.e. not the default export).
Hey Romain, thanks a lot for creating this super useful setup! I stumbled across the same problem. Do you think it would be possible to add the regex from your comment above to the repository?
@tom3q I'm still not sure how to classify that thing: "class definition" or "named export", as it's both and I have no desire to have dupes in the generated tags file. Either way, you could add it to your own fork in the mean time.
Okay, thanks for explanation. I'll keep it in my fork.