File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,16 @@ class Repl {
287
287
// Only complete if the cursor is at the end.
288
288
if (_cursor ! = _line .count) return null
289
289
290
+ if (Command .isCommand (_line )) {
291
+ for (entry in COMMANDS) {
292
+ var command = entry[0 ]
293
+ var line = _line .trimStart ()
294
+ if (command.startsWith (line)) {
295
+ return command[line.count.. - 1 ]
296
+ }
297
+ }
298
+ }
299
+
290
300
for (name in Meta .getModuleVariables ("repl" )) {
291
301
// TODO: Also allow completion if the line ends with an identifier but
292
302
// has other stuff before it.
Original file line number Diff line number Diff line change @@ -289,6 +289,16 @@ static const char* replModuleSource =
289
289
" // Only complete if the cursor is at the end.\n "
290
290
" if (_cursor != _line.count) return null\n "
291
291
" \n "
292
+ " if (Command.isCommand(_line)) {\n "
293
+ " for (entry in COMMANDS) {\n "
294
+ " var command = entry[0]\n "
295
+ " var line = _line.trimStart()\n "
296
+ " if (command.startsWith(line)) {\n "
297
+ " return command[line.count..-1]\n "
298
+ " }\n "
299
+ " }\n "
300
+ " }\n "
301
+ " \n "
292
302
" for (name in Meta.getModuleVariables(\" repl\" )) {\n "
293
303
" // TODO: Also allow completion if the line ends with an identifier but\n "
294
304
" // has other stuff before it.\n "
You can’t perform that action at this time.
0 commit comments