mirror of https://github.com/nodejs/node.git
repl: dynamically lookup the require extensions for tab complete
Removes 2 TODO itemspull/24504/head
parent
621caa7bc5
commit
7611c7cd25
|
@ -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…
Reference in New Issue