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
Make the parentheses optional in if else statement #4417
Conversation
Thanks for the PR. If I paste the code that you try to format in a .slint file and try to compile it, i get the following error:
So it looks like the formater fails to format because it wasn't parsed properly in the first place That is because That is because the code in
We could remove the requirement for parentheses there. The thing is that there is no keyword in slint so one can have It is slightly more complicated, but the solution can be:
Please copy the test that is in tests/cases/conditional/stm.slint into tests/cases/conditional/stm2.slint and remove the parentheses, so we have test for the non-parentheses if. Thanks again for contributing to Slint 🤗 |
thanks for explanation and support |
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.
Thanks for the change. Looks good to me.
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.
Actually maybe there is some documentation that needs adjustments
resolve #4062
Not complete, this will break formatter.
It seems like formatter can't identify if without parentheses.