Skip to content
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

Allow characters other than [A-z] to be used in class diagrams #2779

Closed
aliyome opened this issue Feb 27, 2022 · 3 comments
Closed

Allow characters other than [A-z] to be used in class diagrams #2779

aliyome opened this issue Feb 27, 2022 · 3 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@aliyome
Copy link

aliyome commented Feb 27, 2022

Is your feature request related to a problem? Please describe.

In the class diagram, I tried to put the field and method names in Japanese but I couldn't do it.
For Japanese, the use of Japanese in class diagrams is very descriptive and valuable.
In the current specification, field and method names are specified as \w+ in regular expressions, so only [A-z] can be set.

Describe the solution you'd like

I want to change the regular expression to .+, and I want to allow characters other than [A-z].

Describe alternatives you've considered
None

Additional context
Please see the following figure for the current behavior.
If the field and method names are specified in [A-z], they work correctly.
However, if the field name and method name are specified with characters other than [A-z], such as Japanese, part of the method name will be missing, "*" and "$" will not work, and the return type will not be drawn.

image

If this is unexpected behavior, would it have been better to create an issue as a bug report?

@aliyome aliyome added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Feb 27, 2022
@aliyome
Copy link
Author

aliyome commented Feb 27, 2022

Specifically, I would like to modify this as follows.
However, only this fix causes some tests to fail, so we need additional mods.

const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/;
const methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/;

-  const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/;
-  const methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/;
+  const fieldRegEx = /^(\+|-|~|#)?([^~]+)(~[^~]+~|\[\])?\s+([^!~$]+) *(\*|\$)?$/;
+  const methodRegEx = /^([+|\-|~|#])?(.+) *\( *(.*)\) *(\*|\$)? *(.*[~|[\]]*\s*.*~?)$/;

@jgreywolf
Copy link
Contributor

We are no longer using the fieldRegEx and methodRegEx in order to determine how to organize members. After the release of #4534 this issue may be resolved

@aliyome
Copy link
Author

aliyome commented Jan 19, 2024

Thank you for your support. I apologize for my delayed response. I have checked the current release and confirmed that the issue has been resolved. Thank you!!

@aliyome aliyome closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants