-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
documentation for REPL completion is somewhat obscure #3674
Comments
Of course the obvious interpretation is
yet i don't think my eval function is ever called with that cmd argument being equal to ".scope" ? |
That's #3544 (comment) - I couldn't make it work either. |
I'll keep it on my radar, but I don't think I'll get to looking at it soon. |
Looks like the tab completion is called when it has a object ending with a For example try this var _ = require('lodash');
var repl = require('repl');
var replServer = repl.start({});
replServer.eval = _.wrap(replServer.eval, function(eval, cmd, context, filename, callback) {
console.warn('eval with:', arguments);
arguments[4] = _.wrap(callback, function(resultCallback){
console.warn('result callbackdata:', arguments);
resultCallback.apply(this, Array.prototype.slice.call(arguments, 1));
});
eval.apply(this, Array.prototype.slice.call(arguments, 1));
}); and run on the repl
means that if an object in the scope is in the promt with an ending node implementation is at https://github.com/nodejs/node/blob/v5.x/lib/repl.js |
The offending text doesn't appear to be in the REPL docs anymore. I'm going to close this. Please comment or re-open if there's something I'm misunderstanding. |
On tab completion - eval will be called with .scope as an input string. It is expected to return an array of scope names to be used for the auto-completion.
that doesn't mean much...
The text was updated successfully, but these errors were encountered: