com.jetbrains.plugin.structure.ide.util.KnownIdePackages.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of structure-ide-classes Show documentation
Show all versions of structure-ide-classes Show documentation
Library for resolving class files and resources of IntelliJ Platform IDEs.
/*
* Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.jetbrains.plugin.structure.ide.util
/**
* Utility class that contains list of known IntelliJ IDE packages.
*/
object KnownIdePackages {
private val idePackages: Set by lazy(::readKnownIdePackages)
fun isKnownPackage(packageName: String): Boolean =
idePackages.any { packageName == it || packageName.startsWith("$it.") }
private fun readKnownIdePackages() =
KnownIdePackages::class.java.classLoader
.getResourceAsStream("com.jetbrains.plugin.structure.ide/knownIdePackages.txt")!!
.bufferedReader()
.readLines()
.toSet()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy