Browse Source

repl: dynamically lookup the require extensions for tab complete

Removes 2 TODO items
v0.9.3-release
Nathan Rajlich 12 years ago
parent
commit
7611c7cd25
  1. 6
      lib/repl.js

6
lib/repl.js

@ -454,11 +454,7 @@ REPLServer.prototype.complete = function(line, callback) {
completionGroupsLoaded();
} else if (match = line.match(requireRE)) {
// require('...<Tab>')
//TODO: suggest require.exts be exposed to be introspec registered
//extensions?
//TODO: suggest include the '.' in exts in internal repr: parity with
//`path.extname`.
var exts = ['.js', '.node'];
var exts = Object.keys(require.extensions);
var indexRe = new RegExp('^index(' + exts.map(regexpEscape).join('|') +
')$');

Loading…
Cancel
Save