IJPL-158473 attach sources to bundledModule IntelliJ Platform artifacts

Signed-off-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>


(cherry picked from commit 5d694421ef2a3cc5846ce4fdc3320a73d4b1bf41)

IJ-CR-151317

GitOrigin-RevId: adef0280c7a8c33545ff8c47a6a9c714d64ed03c
This commit is contained in:
Jakub Chrzanowski
2024-12-10 21:52:30 +01:00
committed by intellij-monorepo-bot
parent 9f15c8a644
commit f630f8ccd8

View File

@@ -57,15 +57,18 @@ internal class IntelliJPlatformAttachSourcesProvider : AttachSourcesProvider {
?: IntelliJPlatformProduct.fromCdnCoordinates(coordinates.groupId, coordinates.artifactId) ?: IntelliJPlatformProduct.fromCdnCoordinates(coordinates.groupId, coordinates.artifactId)
return when { return when {
// IntelliJ Platform dependency, such as `com.jetbrains.intellij.idea:ideaIC:2023.2.7` or `idea:ideaIC:2023.2.7` // IntelliJ Platform dependency, such as `com.jetbrains.intellij.idea:ideaIC:2023.2.7`, `idea:ideaIC:aarch64:2024.3`, or `idea:ideaIC:2023.2.7`
product != null -> resolveIntelliJPlatformAction(psiFile, coordinates.version) product != null -> resolveIntelliJPlatformAction(psiFile, coordinates.version)
// IntelliJ Platform bundled plugin, such as `localIde:IC:2023.2.7+445` // IntelliJ Platform bundled plugin, such as `localIde:IC:2023.2.7+445`
coordinates.groupId == "localIde" -> createAttachLocalPlatformSourcesAction(psiFile, coordinates) coordinates.groupId == "localIde" -> createAttachLocalPlatformSourcesAction(psiFile, coordinates)
// IntelliJ Platform bundled plugin, such as `bundledPlugin:Git4Idea:2023.2.7+445` // IntelliJ Platform bundled plugin, such as `bundledPlugin:org.intellij.groovy:IC-243.21565.193`, `bundledPlugin:Git4Idea:2023.2.7+445`
coordinates.groupId == "bundledPlugin" -> createAttachBundledPluginSourcesAction(psiFile, coordinates) coordinates.groupId == "bundledPlugin" -> createAttachBundledPluginSourcesAction(psiFile, coordinates)
// IntelliJ Platform bundled module, such as `bundledModule:intellij.platform.coverage:IC-243.21565.193`
coordinates.groupId == "bundledModule" -> createAttachBundledModuleSourcesAction(psiFile, coordinates)
else -> null else -> null
} }
} }
@@ -120,6 +123,15 @@ internal class IntelliJPlatformAttachSourcesProvider : AttachSourcesProvider {
createAttachSourcesArchiveAction(psiFile, ApiSourceArchive.entries.firstOrNull { it.id == coordinates.artifactId }) createAttachSourcesArchiveAction(psiFile, ApiSourceArchive.entries.firstOrNull { it.id == coordinates.artifactId })
?: resolveIntelliJPlatformAction(psiFile, coordinates.version.substringAfter('-').substringBefore('+')) ?: resolveIntelliJPlatformAction(psiFile, coordinates.version.substringAfter('-').substringBefore('+'))
/**
* Creates an action to attach sources of bundled modules for the IntelliJ Platform.
*
* @param psiFile The PSI file that represents the currently handled class.
* @param coordinates The Maven coordinates of the bundled module whose sources need to be attached.
*/
private fun createAttachBundledModuleSourcesAction(psiFile: PsiFile, coordinates: MavenCoordinates) =
createAttachBundledPluginSourcesAction(psiFile, coordinates)
/** /**
* Attach the provided sources archive. * Attach the provided sources archive.
* *