Closed
Description
I'm putting together a plugin that extracts strings for localization (assuming I should use a plugin since one new "dictionary" file will be emitted based on call expressions in many modules). I'd like to visit call expressions on a subset of the modules in a dependency tree.
Seeing the docs for plugging into the parser, I was hopeful I could provide a callback that would get called for call expressions where the callee matched the supplied identifier.
Specifically, these docs:
call <identifier>(expr: Expression) bailing
abc(1) => call abc
a.b.c(1) => call a.b.c
made me think I could do this:
parser.plugin('call this.context.localize', function(expr) {
// called for this.context.localize() expressions
});
But this callback is not getting called. I can successfully provide a callback for 'call require'
. Am I misinterpreting the docs thinking that this works for other identifiers (and member expressions)?