[LL] anchor module provider for navigation in monorepo

Use information from IDE about anchor module,
to include everything from that module and dependencies into library session
^ KTIJ-24683
This commit is contained in:
Anna Kozlova
2023-06-30 16:36:04 +02:00
committed by teamcity
parent 19fb6e7458
commit f96b5bae48
2 changed files with 49 additions and 1 deletions
@@ -0,0 +1,26 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.providers
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.analysis.project.structure.KtLibraryModule
import org.jetbrains.kotlin.analysis.project.structure.KtSourceModule
/**
* Provide module which contains dependencies of the library.
*
* Is required for navigation in IJ monorepo from kotlin compiler library sources to IJ platform sources.
* Kotlin compiler depends on platform but this dependency is not represented as jars in monorepo
* but should be replaced with given sources.
*/
public interface KotlinAnchorModuleProvider {
public fun getAnchorModule(libraryModule: KtLibraryModule): KtSourceModule?
public companion object {
public fun getInstance(project: Project): KotlinAnchorModuleProvider? =
project.getService(KotlinAnchorModuleProvider::class.java)
}
}