| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3f33d0b commit 7c903ec
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -298,6 +298,7 @@ function REPLServer(prompt, | |||
| 298 | 298 | configurable: true | |
| 299 | 299 | }); | |
| 300 | 300 | ||
| 301 | + this.allowBlockingCompletions = !!options.allowBlockingCompletions; | ||
| 301 | 302 | this.useColors = !!options.useColors; | |
| 302 | 303 | this._domain = options.domain || domain.create(); | |
| 303 | 304 | this.useGlobal = !!useGlobal; | |
@@ -1204,7 +1205,8 @@ function complete(line, callback) { | |||
| 1204 | 1205 | if (completeOn.length) { | |
| 1205 | 1206 | filter = completeOn; | |
| 1206 | 1207 | } | |
| 1207 | - } else if (RegExpPrototypeTest(requireRE, line)) { | ||
| 1208 | + } else if (RegExpPrototypeTest(requireRE, line) && | ||
| 1209 | + this.allowBlockingCompletions) { | ||
| 1208 | 1210 | // require('...<Tab>') | |
| 1209 | 1211 | const extensions = ObjectKeys(this.context.require.extensions); | |
| 1210 | 1212 | const indexes = ArrayPrototypeMap(extensions, | |
@@ -1265,7 +1267,8 @@ function complete(line, callback) { | |||
| 1265 | 1267 | if (!subdir) { | |
| 1266 | 1268 | ArrayPrototypePush(completionGroups, _builtinLibs); | |
| 1267 | 1269 | } | |
| 1268 | - } else if (RegExpPrototypeTest(fsAutoCompleteRE, line)) { | ||
| 1270 | + } else if (RegExpPrototypeTest(fsAutoCompleteRE, line) && | ||
| 1271 | + this.allowBlockingCompletions) { | ||
| 1269 | 1272 | [completionGroups, completeOn] = completeFSFunctions(line); | |
| 1270 | 1273 | // Handle variable member lookup. | |
| 1271 | 1274 | // We support simple chained expressions like the following (no function | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,7 +51,12 @@ function getNoResultsFunction() { | |||
| 51 | 51 | ||
| 52 | 52 | const works = [['inner.one'], 'inner.o']; | |
| 53 | 53 | const putIn = new ArrayStream(); | |
| 54 | - const testMe = repl.start('', putIn); | ||
| 54 | + const testMe = repl.start({ | ||
| 55 | + prompt: '', | ||
| 56 | + input: putIn, | ||
| 57 | + output: process.stdout, | ||
| 58 | + allowBlockingCompletions: true | ||
| 59 | + }); | ||
| 55 | 60 | ||
| 56 | 61 | // Some errors are passed to the domain, but do not callback | |
| 57 | 62 | testMe._domain.on('error', assert.ifError); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments