Permalink
Browse files

repl: dynamically lookup the require extensions for tab complete

Removes 2 TODO items
  • Loading branch information...
1 parent 621caa7 commit 5ba2efaa5e11eaef2a633864badc23d334cc3459 @TooTallNate committed Oct 7, 2012
Showing with 1 addition and 5 deletions.
  1. +1 −5 lib/repl.js
View
@@ -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('|') +
')$');

0 comments on commit 5ba2efa

Please sign in to comment.