eclipse-xtext / eclipse-xtext/xtext
Formatting partially selected lines does not correct indentation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
class Test {
def void main() {
println("Foo");
println("Bar");
}
}
If you select the third line from println up until println on the fourth line and format the file, only the indentation of the fourth line will be fixed.
In Java the indentation of both lines would be fixed. Is there a particular reason why you chose not to follow the same behaviour? In my opinion it would be better if both lines were indented. It seems natural to me that when you're "randomly" selecting multiple lines you want to perform an operation on all of these lines.
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.
Research direction
Reproduce the issue with the Java-like snippet by selecting from the third line through the fourth and formatting the file. Trace the formatting behavior for partially selected lines; done means both selected lines receive corrected indentation, matching the described Java behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100