mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDE external annotations: get rid of unnecessary product codes, download ideaIU annotations always.
GitOrigin-RevId: 19b199ce938efac7f49e6355f181337e25a3df6f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0d23842aab
commit
49f2467978
+4
-11
@@ -31,22 +31,15 @@ class PublicIdeExternalAnnotationsRepository(private val project: Project) : Ide
|
||||
SNAPSHOTS_REPO_URL
|
||||
)
|
||||
|
||||
private val allProductCodes = listOf("IU", "IC", "RM", "PY", "PC", "PE", "PS", "WS", "OC", "CL", "DB", "RD", "GO", "MPS", "AI")
|
||||
|
||||
private val ideaIUAnnotationsCoordinates = "com.jetbrains.intellij.idea" to "ideaIU"
|
||||
}
|
||||
|
||||
private fun getAnnotationsCoordinates(): Pair<String, String>? {
|
||||
//Currently, for any IDE download ideaIU's annotations.
|
||||
private val productCodeToAnnotationsCoordinates = allProductCodes.associate {
|
||||
it to ideaIUAnnotationsCoordinates
|
||||
}
|
||||
|
||||
fun hasAnnotationsForProduct(productCode: String): Boolean =
|
||||
productCode in productCodeToAnnotationsCoordinates
|
||||
return "com.jetbrains.intellij.idea" to "ideaIU"
|
||||
}
|
||||
|
||||
override fun downloadExternalAnnotations(ideBuildNumber: BuildNumber): IdeExternalAnnotations? {
|
||||
val productCode = ideBuildNumber.productCode.takeIf { it.isNotEmpty() } ?: "IU"
|
||||
val (groupId, artifactId) = productCodeToAnnotationsCoordinates[productCode] ?: return null
|
||||
val (groupId, artifactId) = getAnnotationsCoordinates() ?: return null
|
||||
|
||||
val lastReleaseVersion = "${ideBuildNumber.baselineVersion}.999999"
|
||||
val lastReleaseAnnotations = tryDownload(groupId, artifactId, lastReleaseVersion, listOf(RELEASES_REPO_DESCRIPTION))
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class IdeExternalAnnotationsUpdater {
|
||||
}
|
||||
|
||||
fun updateIdeaJdkAnnotationsIfNecessary(project: Project, ideaJdk: Sdk, buildNumber: BuildNumber) {
|
||||
if (!isInspectionEnabled(project) || !PublicIdeExternalAnnotationsRepository.hasAnnotationsForProduct(buildNumber.productCode)) {
|
||||
if (!isInspectionEnabled(project)) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user