Formatter: introduce "Put left brace on new line option", support this option for "if/else" expressions
This commit is contained in:
@@ -3,16 +3,13 @@ class A {
|
||||
|
||||
private fun formatElement(var element: PsiElement): String {
|
||||
element = JetPsiUtil.ascendIfPropertyAccessor(element)
|
||||
if (element is JetNamedFunction || element is JetProperty)
|
||||
{
|
||||
if (element is JetNamedFunction || element is JetProperty) {
|
||||
val bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache((element.getContainingFile() as JetFile)).getBindingContext()
|
||||
|
||||
val declarationDescriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element)
|
||||
if (declarationDescriptor is CallableMemberDescriptor)
|
||||
{
|
||||
if (declarationDescriptor is CallableMemberDescriptor) {
|
||||
val containingDescriptor = declarationDescriptor.getContainingDeclaration()
|
||||
if (containingDescriptor is ClassDescriptor)
|
||||
{
|
||||
if (containingDescriptor is ClassDescriptor) {
|
||||
return JetBundle.message("x.in.y", DescriptorRenderer.COMPACT.render(declarationDescriptor), DescriptorRenderer.SOURCE_CODE_SHORT_NAMES_IN_TYPES.render(containingDescriptor))
|
||||
}
|
||||
}
|
||||
@@ -29,8 +26,7 @@ class A {
|
||||
public fun getSelected(): ArrayList<UsageInfo> {
|
||||
val result = ArrayList<UsageInfo>()
|
||||
for (i in 0..myChecked.length - 1) {
|
||||
if (myChecked[i])
|
||||
{
|
||||
if (myChecked[i]) {
|
||||
result.add(myOverridingMethods.get(i))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user