Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gen.kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = 'GumTree tree generator for Kotlin using Kotlin PSI.'

dependencies {
implementation project(':core')
implementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable:2.3.20'
implementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable:2.4.21'

testImplementation project(':gen.treesitter-ng')
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import com.github.gumtreediff.utils.Registry;
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles;
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
import org.jetbrains.kotlin.cli.FrontendConfigurationKeysKt;
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar;
import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer;
import org.jetbrains.kotlin.com.intellij.openapi.util.TextRange;
import org.jetbrains.kotlin.com.intellij.psi.PsiElement;
Expand Down Expand Up @@ -57,8 +59,11 @@ protected TreeContext generate(Reader reader) throws IOException {

var disposable = Disposer.newDisposable();
try {
CompilerConfiguration configuration = new CompilerConfiguration();
FrontendConfigurationKeysKt.setExtensionsStorage(
configuration, new CompilerPluginRegistrar.ExtensionStorage());
KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForProduction(
disposable, new CompilerConfiguration(), EnvironmentConfigFiles.JVM_CONFIG_FILES);
disposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES);
PsiFile psiFile = PsiFileFactory.getInstance(environment.getProject())
.createFileFromText("file.kt", KotlinLanguage.INSTANCE, content.toString());
TreeContext context = new TreeContext();
Expand Down