User: kyle wood Date: 17 Aug 22 23:12 Revision: 5530d6aa6b2ac1df8f851198cc4f9ab13289a644 Summary: Switch to new alpha K2 compiler TeamCity URL: https://ci.denwav.dev/viewModification.html?tab=vcsModificationFiles&modId=8083&personal=false Index: build.gradle.kts =================================================================== --- build.gradle.kts (revision b76e3705c314ac89d199ce9bc8ed9d7c585321b7) +++ build.gradle.kts (revision 5530d6aa6b2ac1df8f851198cc4f9ab13289a644) @@ -193,7 +193,8 @@ tasks.withType().configureEach { kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() - freeCompilerArgs = listOf("-Xjvm-default=all") + freeCompilerArgs = listOf("-Xuse-k2", "-Xjvm-default=all", "-Xjdk-release=11") + kotlinDaemonJvmArguments.add("-Xmx1G") } } Index: src/main/kotlin/platform/mcp/at/completion/AtCompletionContributor.kt =================================================================== --- src/main/kotlin/platform/mcp/at/completion/AtCompletionContributor.kt (revision b76e3705c314ac89d199ce9bc8ed9d7c585321b7) +++ src/main/kotlin/platform/mcp/at/completion/AtCompletionContributor.kt (revision 5530d6aa6b2ac1df8f851198cc4f9ab13289a644) @@ -204,7 +204,7 @@ val entry = memberName.parent as? AtEntry ?: return - val entryClass = entry.className.classNameValue ?: return + val entryClass = entry.className?.classNameValue ?: return val module = ModuleUtilCore.findModuleForPsiElement(memberName) ?: return val project = module.project Index: src/main/kotlin/translations/TranslationFiles.kt =================================================================== --- src/main/kotlin/translations/TranslationFiles.kt (revision b76e3705c314ac89d199ce9bc8ed9d7c585321b7) +++ src/main/kotlin/translations/TranslationFiles.kt (revision 5530d6aa6b2ac1df8f851198cc4f9ab13289a644) @@ -59,9 +59,13 @@ file?.nameWithoutExtension?.lowercase(Locale.ENGLISH) tailrec fun seekTranslation(element: PsiElement): PsiNamedElement? { - return toTranslation(element)?.let { element as? PsiNamedElement } - ?: seekTranslation(element.parent ?: return null) + // don't use elvis here, K2 doesn't think it's a tail recursive call if you do + val res = toTranslation(element)?.let { element as? PsiNamedElement } + if (res != null) { + return res - } + } + return seekTranslation(element.parent ?: return null) + } fun toTranslation(element: PsiElement): Translation? = if (element.containingFile?.virtualFile?.let { isTranslationFile(it) } == true) {