diff --git a/plugins/org.eclipse.fordiac.ide.model.commands/src/org/eclipse/fordiac/ide/model/commands/QualNameChangeListenerManager.java b/plugins/org.eclipse.fordiac.ide.model.commands/src/org/eclipse/fordiac/ide/model/commands/QualNameChangeListenerManager.java index 37d3331dad..166b5df34f 100644 --- a/plugins/org.eclipse.fordiac.ide.model.commands/src/org/eclipse/fordiac/ide/model/commands/QualNameChangeListenerManager.java +++ b/plugins/org.eclipse.fordiac.ide.model.commands/src/org/eclipse/fordiac/ide/model/commands/QualNameChangeListenerManager.java @@ -45,8 +45,8 @@ private void initializeListeners() { for (final IConfigurationElement element : config) { try { final Object obj = element.createExecutableExtension("class"); - if (obj instanceof QualNameChangeListener) { - listeners.add((QualNameChangeListener) obj); + if (obj instanceof final QualNameChangeListener l) { + listeners.add(l); } } catch (final Exception e) { FordiacLogHelper.logError(EXTENSION_POINT_ID, e); @@ -85,13 +85,19 @@ public void stackChanged(final CommandStackEvent event) { } if (event.getDetail() == CommandStack.POST_MARK_SAVE && event.getSource() instanceof final CommandStack stack) { - final TypeEntry typeEntry = getTypeEntryKeyFromCommandStack(stack); if (typeEntry != null) { notifiyCommit(typeEntry); } } + if (event.getDetail() == CommandStack.POST_FLUSH && event.getSource() instanceof final CommandStack stack) { + final TypeEntry typeEntry = getTypeEntryKeyFromCommandStack(stack); + if (typeEntry != null) { + listeners.forEach(l -> l.flush(typeEntry)); + } + } + } private static TypeEntry getTypeEntryKeyFromCommandStack(final CommandStack stack) {