Updated dependencies, attempt to fix NPE, workaround for scheduled removal of a static field in PsiParserFacade.
Added PluginVerifier to build.gradle.
This commit is contained in:
@@ -115,8 +115,7 @@ fun PsiMethodCallExpression.getExpectedNullNonNullResult(): Boolean? {
|
||||
}
|
||||
|
||||
fun PsiMethodCallExpression.calculateConstantParameterValue(argIndex: Int): Any? {
|
||||
if (argIndex >= argumentList.expressions.size) return null
|
||||
return getArg(argIndex).calculateConstantValue()
|
||||
return getArgOrNull(argIndex)?.calculateConstantValue()
|
||||
}
|
||||
|
||||
fun PsiExpression.calculateConstantValue(): Any? {
|
||||
|
||||
+7
-2
@@ -56,9 +56,14 @@ class JoinStatementsQuickFix(private val separateLineLimit: Int) : AbstractCommo
|
||||
}
|
||||
|
||||
private fun addLineBreak(project: Project, lastElementBeforeConcat: PsiElement) {
|
||||
val newLineNode =
|
||||
val newLineNode = try {
|
||||
PsiParserFacade.getInstance(project).createWhiteSpaceFromText("\n\t")
|
||||
} catch (ex: NoSuchMethodError) {
|
||||
// scheduled for removal, but alternate version not even available in 2020.3.
|
||||
// So keep it here until we run into a problem.
|
||||
// Changing the min version from 2017.3 to 2021.x is a major thing.
|
||||
PsiParserFacade.SERVICE.getInstance(project).createWhiteSpaceFromText("\n\t")
|
||||
|
||||
}
|
||||
lastElementBeforeConcat.addAfter(newLineNode, lastElementBeforeConcat.firstChild)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user