Commit f5e74fb7 authored by dgelessus's avatar dgelessus
Browse files

Also recognize special machine names without .mch in error highlighting

parent 78af527d
Pipeline #46164 passed with stage
in 4 minutes
...@@ -627,10 +627,13 @@ public final class ProBKernel extends BaseKernel { ...@@ -627,10 +627,13 @@ public final class ProBKernel extends BaseKernel {
if (filePath.toString().isEmpty()) { if (filePath.toString().isEmpty()) {
return Optional.ofNullable(contextSourceLines); return Optional.ofNullable(contextSourceLines);
} else { } else {
final String fileName = filePath.getFileName().toString(); String fileName = filePath.getFileName().toString();
if (fileName.equals(DEFAULT_MACHINE_NAME + ".mch")) { if (fileName.endsWith(".mch")) {
fileName = fileName.substring(0, fileName.length() - 4);
}
if (fileName.equals(DEFAULT_MACHINE_NAME)) {
return Optional.of(Arrays.asList(DEFAULT_MACHINE_SOURCE_CODE.split("\n"))); return Optional.of(Arrays.asList(DEFAULT_MACHINE_SOURCE_CODE.split("\n")));
} else if (fileName.equals(LOAD_CELL_MACHINE_NAME + ".mch")) { } else if (fileName.equals(LOAD_CELL_MACHINE_NAME)) {
if (currentCellSourceCode == null) { if (currentCellSourceCode == null) {
return Optional.empty(); return Optional.empty();
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment