MCPcopy Index your code
hub / github.com/nodejs/node / completeOnEditorMode

Method completeOnEditorMode

lib/repl.js:1236–1249  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

1234 ReflectApply(this.completer, this, arguments);
1235 }
1236 completeOnEditorMode(callback) {
1237 return (err, results) => {
1238 if (err) return callback(err);
1239
1240 const { 0: completions, 1: completeOn = '' } = results;
1241 let result = ArrayPrototypeFilter(completions, Boolean);
1242
1243 if (completeOn && result.length !== 0) {
1244 result = [commonPrefix(result)];
1245 }
1246
1247 callback(null, [result, completeOn]);
1248 };
1249 }
1250 defineCommand(keyword, cmd) {
1251 if (typeof cmd === 'function') {
1252 cmd = { action: cmd };

Callers 1

completerMethod · 0.80

Calls 2

commonPrefixFunction · 0.85
callbackFunction · 0.50

Tested by

no test coverage detected