-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
1119 specify method return type in class diagram #1178
1119 specify method return type in class diagram #1178
Conversation
I don't know if the bracket syntax is really helping to keep the syntax plain. I think I would prefer to write a normal UML syntax and have a regex classify whether this member is a field or a method. If we use brackets, we could end up with broken diagrams. |
I suppose if we just stick with a regular UML syntax, then really we dont need to do anything at all, yes? As long as the user understands this and defines their methods accordingly. Explicitly add Or to go with regex, we could just have it that the pattern is like:
which would display as something like: |
After some consideration and playing around, I decided to go ahead and go with the idea of parsing out the text via regex. If for some reason the regex match function fails it will "fallback" to existing functionality of displaying the method as it was typed in. |
Updated ClassRenderer to check for `[]` to indicate return type for method. Small refactor to split out logic for determining method display text and style. Updated documentation
Small refactor to split out logic for determining method display text and style. Updated documentation Used regex to parse method statements in class diagrams to extract discrete elements to set display appropriately. Added tests and updated docs
030c5a3
to
fa1331f
Compare
Force pushed new version due to some oddities in merge from develop. |
📑 Summary
Updated ClassRenderer to check for
[]
to indicate return type for method. Small refactor to split out logic for determining method display text and style. Updated documentationResolves #1119
📏 Design Decisions
Still using existence of
)
to determine if member is a method, but using regex to parse out method text into discrete elements (visibility, method name, parameters, classifier and return type)📋 Tasks
Make sure you
develop
branch