Skip to content
Snippets Groups Projects
Commit cd2f78b7 authored by dgelessus's avatar dgelessus
Browse files

Add simple ProBKernel.isComplete implementation for console mode

This allows using multiline commands (like ::load) properly when using
the Jupyter console.
parent cfaae744
No related branches found
No related tags found
No related merge requests found
......@@ -331,6 +331,17 @@ public final class ProBKernel extends BaseKernel {
}
}
@Override
public String isComplete(final String code) {
final Matcher commandMatcher = COMMAND_PATTERN.matcher(code);
if (commandMatcher.matches() && commandMatcher.group(1).startsWith("::")) {
return code.endsWith("\n") ? IS_COMPLETE_MAYBE : "";
} else {
// TODO Support line continuation for normal commands
return IS_COMPLETE_MAYBE;
}
}
@Override
public @NotNull LanguageInfo getLanguageInfo() {
return new LanguageInfo.Builder("prob")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment