mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Adapt to PSI parsing change for property accessor with parenthesis
^KT-70922 GitOrigin-RevId: 210c5987f4162929d76a52b3827ffc852b5d0b3a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
92be60ae77
commit
d52ec27b27
+3
-1
@@ -27,7 +27,9 @@ class KotlinPropertySetterParametersFixer : SmartEnterProcessorWithFixers.Fixer<
|
||||
|
||||
val doc = editor.document
|
||||
|
||||
val parameterOffset = (psiElement.leftParenthesis?.node?.startOffset ?: return) + 1
|
||||
val leftParenthesis = psiElement.leftParenthesis ?: psiElement.parameterList?.leftParenthesis
|
||||
|
||||
val parameterOffset = (leftParenthesis?.node?.startOffset ?: return) + 1
|
||||
|
||||
if (parameter?.text.isNullOrBlank()) {
|
||||
if (psiElement.rightParenthesis == null) {
|
||||
|
||||
+1
-1
@@ -331,7 +331,7 @@ class KotlinTypedHandler : TypedHandlerDelegate() {
|
||||
}
|
||||
|
||||
c == '(' -> {
|
||||
if (KotlinTypedHandlerHelper.autoIndentCase(editor, project, file, KtPropertyAccessor::class.java, forFirstElement = false)) return Result.STOP
|
||||
if (KotlinTypedHandlerHelper.autoIndentCase(editor, project, file, KtParameterList::class.java, forFirstElement = false)) return Result.STOP
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,8 +165,7 @@ fun KtDeclaration.isEffectivelyActual(checkConstructor: Boolean = true): Boolean
|
||||
}
|
||||
|
||||
fun KtPropertyAccessor.deleteBody() {
|
||||
val leftParenthesis = leftParenthesis ?: return
|
||||
deleteChildRange(leftParenthesis, lastChild)
|
||||
deleteChildRange(parameterList ?: return, lastChild)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-2
@@ -4,5 +4,4 @@ class Test {
|
||||
)
|
||||
}
|
||||
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
// IGNORE_FORMATTER
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
+1
-2
@@ -2,5 +2,4 @@ class Test {
|
||||
val a: Boolean get(<caret>)
|
||||
}
|
||||
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
// IGNORE_FORMATTER
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
+1
-2
@@ -6,5 +6,4 @@ class Test {
|
||||
)
|
||||
}
|
||||
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
// IGNORE_FORMATTER
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
+1
-2
@@ -4,5 +4,4 @@ class Test {
|
||||
set(<caret>)
|
||||
}
|
||||
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
// IGNORE_FORMATTER
|
||||
// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
Reference in New Issue
Block a user