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 {
287287 // Only complete if the cursor is at the end.
288288 if (_cursor ! = _line .count) return null
289289
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+
290300 for (name in Meta .getModuleVariables ("repl" )) {
291301 // TODO: Also allow completion if the line ends with an identifier but
292302 // has other stuff before it.
Original file line number Diff line number Diff line change @@ -289,6 +289,16 @@ static const char* replModuleSource =
289289" // Only complete if the cursor is at the end.\n "
290290" if (_cursor != _line.count) return null\n "
291291" \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 "
292302" for (name in Meta.getModuleVariables(\" repl\" )) {\n "
293303" // TODO: Also allow completion if the line ends with an identifier but\n "
294304" // has other stuff before it.\n "
You can’t perform that action at this time.
0 commit comments