AA: expose library modules in the project structure
This commit is contained in:
committed by
Ilya Kirillov
parent
dcc349da0d
commit
cbef3faae7
+7
-1
@@ -13,6 +13,12 @@ public abstract class ProjectStructureProvider {
|
||||
* For a given [PsiElement] get a [KtModule] to which [PsiElement] belongs.
|
||||
*/
|
||||
public abstract fun getKtModuleForKtElement(element: PsiElement): KtModule
|
||||
|
||||
/**
|
||||
* Returns all [KtLibraryModule]s in this project.
|
||||
*/
|
||||
// TODO: We rather need a session or facade that maintains this information.
|
||||
public abstract fun getKtLibraryModules(): Collection<KtLibraryModule>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,4 +43,4 @@ public inline fun <reified M : KtModule> PsiElement.getKtModuleOfType(project: P
|
||||
* @param project [Project] which contains current [PsiElement]. `PsiElement.project` may be a heavy operation as it includes PSI tree traversal. So, when a [Project] is already available, it is better to pass it explicitly
|
||||
*/
|
||||
public inline fun <reified M : KtModule> PsiElement.getKtModuleOfTypeSafe(project: Project = this.project): M? =
|
||||
getKtModule(project) as M?
|
||||
getKtModule(project) as M?
|
||||
|
||||
Reference in New Issue
Block a user