Skip to content

Commit

Permalink
Merge pull request #2018 from lf-lang/kieler-incremental
Browse files Browse the repository at this point in the history
Stabilize diagram genenation via the language server
  • Loading branch information
cmnrd authored Sep 22, 2023
2 parents 4aa386d + d61d3e6 commit 50445fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ public class LinguaFrancaSynthesis extends AbstractDiagramSynthesis<Model> {
SynthesisOption.<Integer>createRangeOption("Reactor Parameter/Variable Columns", 1, 10, 1)
.setCategory(APPEARANCE);

public static final SynthesisOption DEFAULT_EXPAND_ALL =
SynthesisOption.createCheckOption("Expand reactors by default", false);

public static final SynthesisOption FIXED_PORT_SIDE =
SynthesisOption.createCheckOption("Fixed Port Sides", true).setCategory(LAYOUT);
public static final SynthesisOption SPACING =
Expand All @@ -273,6 +276,7 @@ public class LinguaFrancaSynthesis extends AbstractDiagramSynthesis<Model> {
public List<SynthesisOption> getDisplayedSynthesisOptions() {
return List.of(
SHOW_ALL_REACTORS,
DEFAULT_EXPAND_ALL,
MemorizingExpandCollapseAction.MEMORIZE_EXPANSION_STATES,
CYCLE_DETECTION,
APPEARANCE,
Expand Down Expand Up @@ -1019,18 +1023,16 @@ private Collection<KNode> transformReactorNetwork(
TriggerInstance<?> reset = null;

// Transform instances
int index = 0;
for (ReactorInstance child : reactorInstance.children) {
Boolean expansionState = MemorizingExpandCollapseAction.getExpansionState(child);
Collection<KNode> rNodes =
createReactorNode(
child,
expansionState != null ? expansionState : false,
expansionState != null ? expansionState : getBooleanValue(DEFAULT_EXPAND_ALL),
inputPorts,
outputPorts,
allReactorNodes);
nodes.addAll(rNodes);
index++;
}

// Create timers
Expand Down
7 changes: 7 additions & 0 deletions lsp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ dependencies {
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt.*'
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt'
}

// This dependency ensures correct animations and bookkeeping during updates
// See https://github.com/lf-lang/vscode-lingua-franca/issues/103#issuecomment-1731023470
implementation ("de.cau.cs.kieler.klighd:de.cau.cs.kieler.klighd.incremental:$klighdVersion") {
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt.*'
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt'
}
}

application {
Expand Down

0 comments on commit 50445fd

Please sign in to comment.