Changed workaround according to recommendation by Jetbrains.

This commit is contained in:
Chris Hodges 2022-08-17 20:28:18 +02:00
parent 1ee532b577
commit f3bc2c1a0b
3 changed files with 4 additions and 10 deletions

View File

@ -834,7 +834,7 @@ Feel free to use the code (in package ```de.platon42.intellij.jupiter```) for yo
## Changelog
### V1.13 (15-Aug-22)
### V1.13 (17-Aug-22)
- Maintenance. Updated various dependencies (Kotlin 1.7.10) and AssertJ 3.23.1 and AssertJ-Guava 3.5.0.
- Tried to fix unreproducible issue #9.

View File

@ -54,7 +54,7 @@ runPluginVerifier {
patchPluginXml {
setChangeNotes("""
<h4>V1.13 (15-Aug-22)</h4>
<h4>V1.13 (17-Aug-22)</h4>
<ul>
<li>Maintenance. Updated various dependencies (Kotlin 1.7.10) and AssertJ 3.23.1 and AssertJ-Guava 3.5.0.
<li>Tried to fix unreproducible issue #9.

View File

@ -56,14 +56,8 @@ class JoinStatementsQuickFix(private val separateLineLimit: Int) : AbstractCommo
}
private fun addLineBreak(project: Project, lastElementBeforeConcat: PsiElement) {
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")
}
// was PsiParserFacade.getInstance(project).createWhiteSpaceFromText("\n\t"), changed due to breaking API changes
val newLineNode = project.getService(PsiParserFacade::class.java).createWhiteSpaceFromText("\n\t")
lastElementBeforeConcat.addAfter(newLineNode, lastElementBeforeConcat.firstChild)
}