New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 852962 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Android Studio's format style is different from git cl format for lambda

Project Member Reported by s...@chromium.org, Jun 14 2018

Issue description

The following line is preserved with git cl format

mRequestManager.triggerRefresh(RequestReason.SCHEDULED_REFRESH, ignored -> {});

But Android Studio's format changes it to

mRequestManager.triggerRefresh(RequestReason.SCHEDULED_REFRESH, ignored -> {
});

We should keep these two unified, probably by changing tools/android/android_studio/ChromiumStyle.xml
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f6a4ebfadc3762f68c2d22e09e715255353895ad

commit f6a4ebfadc3762f68c2d22e09e715255353895ad
Author: Sky Malice <skym@google.com>
Date: Thu Jun 14 23:15:59 2018

Update Android Studio's ChromiumStyle.xml for lambdas.

Previously if you had an empty lambda, Android Studio would insert a
new line, and then git cl format would remove the newline, and the two
would fight forever. This makes them both agree that no newline is
better.

git cl format and new Android Studio format:
obj.foo(ignored -> {});

old Android Studio format:
obj.foo(ignored -> {
});

Bug:  852962 
Change-Id: I785e3264454efbf0118d5fcc36c43ca88076a624
Reviewed-on: https://chromium-review.googlesource.com/1101715
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567469}
[modify] https://crrev.com/f6a4ebfadc3762f68c2d22e09e715255353895ad/tools/android/android_studio/ChromiumStyle.xml

Comment 2 by s...@chromium.org, Jun 14 2018

Status: Fixed (was: Started)

Sign in to add a comment