-
Notifications
You must be signed in to change notification settings - Fork 66
Add nn for conversion of enhanced for loop to foreach #578
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -33,6 +33,36 @@ When navigating to a declaration, implementation, or method within the same edit | |||||
|
|
||||||
| This makes it easier to inspect implementations, compare code, and work with multiple locations in parallel without losing your current position. | ||||||
|
|
||||||
| ### Enhanced For-loop to ForEach Quick Assist | ||||||
|
|
||||||
| <details> | ||||||
| <summary>Contributors</summary> | ||||||
|
|
||||||
| [Ivan Gualandri](https://github.com/inuyasha82) | ||||||
| [Carsten Hammer](https://github.com/carstenartur) | ||||||
| </details> | ||||||
|
|
||||||
| With this new quick assist, on a enhanced for-loop like the following: | ||||||
|
|
||||||
| ```java | ||||||
| for (String adj : list) { | ||||||
| System.out.println(adj); | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| if the list item is an Iterable object a new option is added: `Convert Enhanced for loop to forEach`. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The text of the option should look exactly like it does in the IDE, where I think there are |
||||||
| This let the user to convert the loop above, with a `forEach` statement: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```java | ||||||
| list.forEach(adj -> { | ||||||
| System.out.println(adj); | ||||||
| }); | ||||||
| ``` | ||||||
| Below an animation of the new quick assist: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|  | ||||||
|
|
||||||
|
|
||||||
| <!-- | ||||||
| --- | ||||||
| ## Java Views and Dialogs | ||||||
|
|
||||||
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.