Skip to content

Add nn for conversion of enhanced for loop to foreach#578

Open
inuyasha82 wants to merge 1 commit into
eclipse-platform:masterfrom
inuyasha82:add_foreach_conversion
Open

Add nn for conversion of enhanced for loop to foreach#578
inuyasha82 wants to merge 1 commit into
eclipse-platform:masterfrom
inuyasha82:add_foreach_conversion

Conversation

@inuyasha82

Copy link
Copy Markdown
Contributor

Add new n&n news for the new conversion from enhanced loop for to forEach method.

Implements this issue: eclipse-jdt/eclipse.jdt.ui#2934
Relevant pr: eclipse-jdt/eclipse.jdt.ui#3002

@merks merks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small typos and grammar issues.

I wonder in general if the result performs worse and/or if it's harder to debug? (Maybe I"m too old fashioned!)

Comment thread news/4.41/jdt.md
[Carsten Hammer](https://github.com/carstenartur)
</details>

With this new quick assist, on a enhanced for-loop like the following:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With this new quick assist, on a enhanced for-loop like the following:
With this new quick assist, on an enhanced for-loop like the following:

Comment thread news/4.41/jdt.md
}
```

if the list item is an Iterable object a new option is added: `Convert Enhanced for loop to forEach`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if the list item is an Iterable object a new option is added: `Convert Enhanced for loop to forEach`.
if the list item is an `Iterable` object, a new option is available: `Convert Enhanced 'for' loop to 'forEach'`.

The text of the option should look exactly like it does in the IDE, where I think there are ' characters that are missing.

Comment thread news/4.41/jdt.md
```

if the list item is an Iterable object a new option is added: `Convert Enhanced for loop to forEach`.
This let the user to convert the loop above, with a `forEach` statement:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This let the user to convert the loop above, with a `forEach` statement:
This converts the loop above, with a `forEach` statement:

Comment thread news/4.41/jdt.md
System.out.println(adj);
});
```
Below an animation of the new quick assist:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Below an animation of the new quick assist:
Below is an animation of the new quick assist:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants