Hi,
unsatisfied with the available options for javascript code completion in vim I recently spent some time evaluating some options.
What I ended up with was tunnelling expressions to a running phantomjs instance for inspection.
While that wasn't all that hard I realised that deciding what part of a line of text should actually be completed/inspected isn't
quite obvious or trivial.
Now I'm wondering if esprima might be an option for this. I'd like to ask for some input if developers think that this is a feasible
usage scenario for esprima. From what i gathered by looking at the documentation and playing around in node it of course isn't
exactly meant for this purpose, i.e it will just fail if I pass it say "if (app.foo.someVal." but I guess scenarios like this could be
fixed/handled by balancing parens and removing trailing "." and such transforming te input to "if (app.foo.someVal) {}" before
passing it to esprima. In which case I could retrieve the last (only) identifier token as "app.foo.someVal" and inspect that.
Yet i'm far from being knowledgable on this topic so any kind of input would be appreciated. Is esprima completely wrong
for this ?
thanks in advance,
Tobi