Formatting of conditional expressions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Use the issue's multiline conditional-expression examples as the expected behavior, then locate the formatter entry point for conditional expressions in the Xtext codebase. Add regression coverage for the reported alignment and verify the formatter output against the chosen expected layout.
Written by the indexing model from the issue text.
Description
The formatting of conditional expressions produces confusing results when the expression is broken into multiple lines.
One example:
return resolve(element.referenceType, if (project_type != ProjectType.PROTOBUF)
element.referenceType.mainProjectType
else
project_type)
Here, it is confusing that the else is aligned with the return rather than the if.
I would expect something like:
return resolve(element.referenceType, if (project_type != ProjectType.PROTOBUF)
element.referenceType.mainProjectType
else
project_type)
or, in this case maybe even better:
return resolve(element.referenceType,
if (project_type != ProjectType.PROTOBUF)
element.referenceType.mainProjectType
else
project_type
)
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-xtext/xtext
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eclipse-xtext/xtext#3727 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eclipse-xtext/xtext#3668 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
eclipse-xtext/xtext#3797 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
eclipse-xtext/xtext#3796 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
eclipse-xtext/xtext#3795 · 1 comment ·
All issues in eclipse-xtext/xtext
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
spring-projects/spring-modulith#1895 ·