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)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import de.platon42.intellij.jupiter.LightCodeInsightExtension
|
||||
import de.platon42.intellij.jupiter.TestDataPath
|
||||
import de.platon42.intellij.jupiter.TestJdk
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.assertj.core.api.Condition
|
||||
import org.junit.jupiter.api.DisplayNameGeneration
|
||||
import org.junit.jupiter.api.DisplayNameGenerator
|
||||
import org.junit.jupiter.api.extension.ExtendWith
|
||||
@@ -39,11 +40,8 @@ abstract class AbstractCajonTest {
|
||||
}
|
||||
|
||||
protected fun assertHighlightings(myFixture: JavaCodeInsightTestFixture, count: Int, snippet: String) {
|
||||
val highlights = myFixture.doHighlighting()
|
||||
.asSequence()
|
||||
.filter { it.description?.contains(snippet) ?: false }
|
||||
.toList()
|
||||
assertThat(highlights).hasSize(count)
|
||||
assertThat(myFixture.doHighlighting())
|
||||
.areExactly(count, Condition({ it.description?.contains(snippet) ?: false }, "containing"))
|
||||
}
|
||||
|
||||
class CutOffFixtureDisplayNameGenerator : DisplayNameGenerator.ReplaceUnderscores() {
|
||||
|
||||
Reference in New Issue
Block a user