Skip to content

Commit 20975ac

Browse files
committed
Merge branch '2022.2' into 2022.3
# Conflicts: # build.gradle.kts
2 parents 0b4be1f + 52338e5 commit 20975ac

File tree

6 files changed

+27
-15
lines changed

6 files changed

+27
-15
lines changed

build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ tasks.withType<JavaCompile>().configureEach {
188188
tasks.withType<KotlinCompile>().configureEach {
189189
kotlinOptions {
190190
jvmTarget = JavaVersion.VERSION_17.toString()
191-
freeCompilerArgs = listOf("-Xjvm-default=all")
191+
// K2 causes the following error: https://youtrack.jetbrains.com/issue/KT-52786
192+
freeCompilerArgs = listOf(/*"-Xuse-k2", */"-Xjvm-default=all", "-Xjdk-release=17")
193+
kotlinDaemonJvmArguments.add("-Xmx1G")
192194
}
193195
}
194196

readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Minecraft Development for IntelliJ
1212
<td colspan="2"><a href="https://ci.demonwav.com/viewType.html?buildTypeId=MinecraftDev_Build"><img src="https://tc.demonwav.com/app/rest/builds/buildType:(id:MinecraftDev_Build)/statusIcon.svg" alt="Teamcity Build Status" /></a></td>
1313
</tr>
1414
<tr>
15-
<td align="right" rowspan="4"><b>Nightly Builds</b></td>
15+
<td align="right" rowspan="5"><b>Nightly Builds</b></td>
1616
<td align="left">2021.2</td>
1717
<td align="left"><a href="https://ci.denwav.dev/viewType.html?buildTypeId=MinecraftDev_Nightly_20212"><img src="https://ci.denwav.dev/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20212)/statusIcon.svg" alt="2021.2 Nightly Status" /></a></td>
1818
</tr>
@@ -28,6 +28,10 @@ Minecraft Development for IntelliJ
2828
<td align="left">2022.2</td>
2929
<td align="left"><a href="https://ci.denwav.dev/viewType.html?buildTypeId=MinecraftDev_Nightly_20222"><img src="https://ci.denwav.dev/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20222)/statusIcon.svg" alt="2022.2 Nightly Status" /></a></td>
3030
</tr>
31+
<tr>
32+
<td align="left">2022.3</td>
33+
<td align="left"><a href="https://ci.denwav.dev/viewType.html?buildTypeId=MinecraftDev_Nightly_20223"><img src="https://ci.denwav.dev/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20223)/statusIcon.svg" alt="2022.3 Nightly Status" /></a></td>
34+
</tr>
3135
<tr>
3236
<td align="right"><b>OS Tests</b></td>
3337
<td align="left" colspan="2">
@@ -36,7 +40,7 @@ Minecraft Development for IntelliJ
3640
</tr>
3741
</table>
3842

39-
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.5.19-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
43+
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.5.20-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
4044
----------------------
4145

4246
<a href="https://discord.gg/j6UNcfr"><img src="https://i.imgur.com/JXu9C1G.png" height="48px"></img></a>

settings.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
rootProject.name = "MinecraftDev"
1212

13-
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS_FULL
14-
1513
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
1614

1715
include("mixin-test-data")

src/main/kotlin/nbt/lang/colors/NbttAnnotator.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ package com.demonwav.mcdev.nbt.lang.colors
1313
import com.demonwav.mcdev.nbt.lang.gen.psi.NbttByte
1414
import com.demonwav.mcdev.nbt.lang.gen.psi.NbttDouble
1515
import com.demonwav.mcdev.nbt.lang.gen.psi.NbttFloat
16-
import com.demonwav.mcdev.nbt.lang.gen.psi.NbttInt
1716
import com.demonwav.mcdev.nbt.lang.gen.psi.NbttLong
1817
import com.demonwav.mcdev.nbt.lang.gen.psi.NbttShort
1918
import com.demonwav.mcdev.nbt.lang.gen.psi.NbttString
@@ -70,12 +69,11 @@ class NbttAnnotator : Annotator {
7069

7170
private fun annotateTypes(element: PsiElement, holder: AnnotationHolder) {
7271
when (element) {
73-
is NbttByte -> holder.newAnnotation(HighlightSeverity.INFORMATION, "byte").range(element).create()
74-
is NbttShort -> holder.newAnnotation(HighlightSeverity.INFORMATION, "short").range(element).create()
75-
is NbttInt -> holder.newAnnotation(HighlightSeverity.INFORMATION, "int").range(element).create()
76-
is NbttLong -> holder.newAnnotation(HighlightSeverity.INFORMATION, "long").range(element).create()
77-
is NbttFloat -> holder.newAnnotation(HighlightSeverity.INFORMATION, "float").range(element).create()
78-
is NbttDouble -> holder.newAnnotation(HighlightSeverity.INFORMATION, "double").range(element).create()
72+
is NbttByte -> holder.newAnnotation(HighlightSeverity.INFORMATION, "Type: byte").range(element).create()
73+
is NbttShort -> holder.newAnnotation(HighlightSeverity.INFORMATION, "Type: short").range(element).create()
74+
is NbttLong -> holder.newAnnotation(HighlightSeverity.INFORMATION, "Type: long").range(element).create()
75+
is NbttFloat -> holder.newAnnotation(HighlightSeverity.INFORMATION, "Type: float").range(element).create()
76+
is NbttDouble -> holder.newAnnotation(HighlightSeverity.INFORMATION, "Type: double").range(element).create()
7977
}
8078
}
8179
}

src/main/kotlin/platform/mcp/at/completion/AtCompletionContributor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class AtCompletionContributor : CompletionContributor() {
204204

205205
val entry = memberName.parent as? AtEntry ?: return
206206

207-
val entryClass = entry.className.classNameValue ?: return
207+
val entryClass = entry.className?.classNameValue ?: return
208208

209209
val module = ModuleUtilCore.findModuleForPsiElement(memberName) ?: return
210210
val project = module.project

src/main/kotlin/translations/TranslationFiles.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ object TranslationFiles {
5959
file?.nameWithoutExtension?.lowercase(Locale.ENGLISH)
6060

6161
tailrec fun seekTranslation(element: PsiElement): PsiNamedElement? {
62-
return toTranslation(element)?.let { element as? PsiNamedElement }
63-
?: seekTranslation(element.parent ?: return null)
62+
// don't use elvis here, K2 doesn't think it's a tail recursive call if you do
63+
val res = toTranslation(element)?.let { element as? PsiNamedElement }
64+
if (res != null) {
65+
return res
66+
}
67+
return seekTranslation(element.parent ?: return null)
6468
}
6569

6670
fun toTranslation(element: PsiElement): Translation? =
@@ -188,6 +192,9 @@ object TranslationFiles {
188192
is FileEntry.Comment -> result.append("# ${entry.text}\n")
189193
is FileEntry.Translation -> result.append("${entry.key}=${entry.text}\n")
190194
FileEntry.EmptyLine -> result.append('\n')
195+
// TODO: IntelliJ shows a false error here without the `else`. The compiler doesn't care because
196+
// FileEntry is a sealed class. When this bug in IntelliJ is fixed, remove this `else`.
197+
else -> {}
191198
}
192199
}
193200

@@ -222,6 +229,9 @@ object TranslationFiles {
222229
result.append("\"${StringUtil.escapeStringCharacters(entry.text)}\",\n")
223230
}
224231
FileEntry.EmptyLine -> result.append('\n')
232+
// TODO: IntelliJ shows a false error here without the `else`. The compiler doesn't care because
233+
// FileEntry is a sealed class. When this bug in IntelliJ is fixed, remove this `else`.
234+
else -> {}
225235
}
226236
}
227237

0 commit comments

Comments
 (0)