eclipse-jdt / eclipse-jdt/eclipse.jdt.ui
Improve Indentation Handling for Snippet Tag file / class
- Dominant language
- Java
- Stars
- 59
- Forks
- 127
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 35
Description
- The main intention of the [snippet tag ](https://openjdk.org/jeps/413#:~:text=of%20this%20proposal.-,Success%20Metrics,-Demonstrate%20the%20ability)is to provide an alternative to `
{@code},` which works well for `{@snippet :` . However, the same approach can also be applied to the class/file snippet tags, as it would improve readability for users.
```
/**
* The following code shows how to use {@code Optional.isPresent}:
* {@snippet class="ShowOptional" region="example"}
*/
public class SnippetMain {
public static void main(String[] args) {
System.out.println("sasi");
}
}
```
```
import java.util.Optional;
public class ShowOptional {
void show(Optional v) {
// @start region="example"
if (v.isPresent()) {
System.out.println("v: " + v.get());
}
// @end
}
}
```
Contributor guide
Research direction
No source file or test is named. Start by reproducing the class and file snippet examples in the issue, then trace the snippet-tag handling and compare their indentation with the inline {@snippet} behavior; done means the class/file examples render with improved, readable indentation without regressing existing snippet output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100