Skip to content

Commit

Permalink
If Show All Reactors is selected, suppress the red No Main Reactor ic…
Browse files Browse the repository at this point in the history
…on that gets generated
  • Loading branch information
edwardalee authored and cmnrd committed Apr 19, 2022
1 parent 0825c08 commit 66c59d1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public KNode transform(final Model model) {
if (main != null) {
ReactorInstance reactorInstance = new ReactorInstance(main, new SynthesisErrorReporter());
rootNode.getChildren().addAll(createReactorNode(reactorInstance, true, null, null, new HashMap<>()));
} else {
} else if (!getBooleanValue(SHOW_ALL_REACTORS)) {
KNode messageNode = _kNodeExtensions.createNode();
_linguaFrancaShapeExtensions.addErrorMessage(messageNode, TEXT_NO_MAIN_REACTOR, null);
rootNode.getChildren().add(messageNode);
Expand All @@ -264,6 +264,8 @@ public KNode transform(final Model model) {

int index = 0;
for (KNode node : reactorNodes) {
// Element could be null if there is no main reactor and Show All Reactors is checked.
if (node == null) continue;
if (node.getProperty(CoreOptions.COMMENT_BOX)) continue;
KNode child = _kNodeExtensions.createNode();
child.getChildren().add(node);
Expand Down

0 comments on commit 66c59d1

Please sign in to comment.