mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[external annotations] fix lookup of bundled annotations list IDEA-243907
GitOrigin-RevId: 84dede4686bb93937c8b3e1183e1b123338290dc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
971216100f
commit
a9a74d6917
+9
-7
@@ -14,7 +14,7 @@ import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.util.text.VersionComparatorUtil
|
||||
|
||||
class JBBundledAnnotationsProvider : AnnotationsLocationProvider {
|
||||
private val myPluginId = PluginManagerCore.CORE_ID
|
||||
private val myPluginId = PluginManagerCore.JAVA_PLUGIN_ID
|
||||
private val knownAnnotations: Map<String, Map<VersionRange, AnnotationsLocation>> by lazy { buildAnnotations() }
|
||||
|
||||
override fun getLocations(project: Project,
|
||||
@@ -34,12 +34,14 @@ class JBBundledAnnotationsProvider : AnnotationsLocationProvider {
|
||||
|
||||
private fun buildAnnotations(): Map<String, Map<VersionRange, AnnotationsLocation>> {
|
||||
val extensionsRootType = ExtensionsRootType.getInstance()
|
||||
val annotationsFile = extensionsRootType.findResource(myPluginId, "predefinedExternalAnnotations.json")
|
||||
?: extensionsRootType.run {
|
||||
extractBundledResources(myPluginId, "")
|
||||
findResource(myPluginId, "predefinedExternalAnnotations.json")
|
||||
}
|
||||
?: return emptyMap()
|
||||
var annotationsFile = extensionsRootType.findResource(myPluginId, "predefinedExternalAnnotations.json")
|
||||
if (annotationsFile?.exists() != true) {
|
||||
extensionsRootType.extractBundledResources(myPluginId, "")
|
||||
annotationsFile = extensionsRootType.findResource(myPluginId, "predefinedExternalAnnotations.json")
|
||||
if (annotationsFile?.exists() != true) {
|
||||
return emptyMap()
|
||||
}
|
||||
}
|
||||
|
||||
val gsonBuilder = GsonBuilder()
|
||||
gsonBuilder.registerTypeAdapter(VersionRange::class.java, VersionRangeTypeAdapter())
|
||||
|
||||
Reference in New Issue
Block a user