-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display reaction names in diagrams and deprecated the @label
attribute
#2016
Conversation
4fd165a
to
90609e8
Compare
90609e8
to
b155b29
Compare
I haven't looked at the code, but let's make sure to keep the |
import org.lflang.lf.Model; | ||
import org.lflang.lf.Reactor; | ||
import org.lflang.lf.StateVar; | ||
import org.lflang.lf.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The style guide forbids these:
Wildcard imports, static or otherwise, are not used.
commentText = ((Reaction) element).getName(); | ||
} | ||
// If the element does not have a name, check if it has an @label attribute | ||
// TODO: the @label attribute is depricaetd and should be removed at release 0.7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: the @label attribute is depricaetd and should be removed at release 0.7.0 | |
// TODO: the @label attribute is deprecated and should be removed at release 0.7.0 |
if (element instanceof Reaction) { | ||
commentText = ((Reaction) element).getName(); | ||
} | ||
// If the element does not have a name, check if it has an @label attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still be able to write @label("Some description")
next to a reactor class and show it. I think that this change should cement that for reactions, either the reaction name (if it is specified) or a numeral is shown inside the chevron, but I'm starting to think that we should still keep the @label
around (also for reactions) to serve as additional explanation in the diagram, just as we have them for reactor classes.
Yes, I actually had the same thought. Otherwise, we would be conflating names with annotations. I'll try to find an alternative solution. |
Closing this in favor of #2030 |
Fixes #1856. Note that this does not ensure yet, that the target code generators actually name the reactions as given in the LF code. For targets not supporting bodyless reactions, this is purely cosmetic and not a strict requirement.