All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gitlab.arturbosch.detekt.test.KotlinCoreEnvironmentExtensions.kt Maven / Gradle / Ivy

package io.gitlab.arturbosch.detekt.test

import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.NoScopeRecordCliBindingTrace
import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.lazy.declarations.FileBasedDeclarationProviderFactory

fun KotlinCoreEnvironment.getContextForPaths(paths: List): BindingContext =
    TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
        this.project,
        paths,
        NoScopeRecordCliBindingTrace(),
        this.configuration,
        this::createPackagePartProvider,
        ::FileBasedDeclarationProviderFactory
    ).bindingContext




© 2015 - 2025 Weber Informatics LLC | Privacy Policy