mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
kotlin: use new reflection-less functions to work with compiler arguments
see 7480befe32
GitOrigin-RevId: 2f2bd2ef343ff92d1df8f44c5ccda6994f97e554
This commit is contained in:
committed by
intellij-monorepo-bot
parent
216d5ed19e
commit
a16b24fc6d
@@ -13,6 +13,8 @@ import com.intellij.util.containers.ContainerUtil
|
||||
import org.jetbrains.kotlin.assignment.plugin.AssignmentPluginNames.ANNOTATION_OPTION_NAME
|
||||
import org.jetbrains.kotlin.assignment.plugin.AssignmentPluginNames.PLUGIN_ID
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.arguments.Freezable
|
||||
import org.jetbrains.kotlin.cli.common.arguments.copyCommonCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
|
||||
import org.jetbrains.kotlin.idea.compilerPlugin.CachedAnnotationNames
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
@@ -73,7 +75,11 @@ internal class AssignmentAnnotationNamesCache(project: Project) {
|
||||
}
|
||||
|
||||
private fun ScriptDefinition.getSpecialAnnotations(annotationPrefix: String): List<String> {
|
||||
val arguments = object : CommonCompilerArguments() {}
|
||||
class CommonCompilerArgumentsHolder: CommonCompilerArguments() {
|
||||
override fun copyOf(): Freezable = copyCommonCompilerArguments(this, CommonCompilerArgumentsHolder())
|
||||
}
|
||||
|
||||
val arguments = CommonCompilerArgumentsHolder()
|
||||
parseCommandLineArguments(compilerOptions.toList(), arguments)
|
||||
return arguments.pluginOptions
|
||||
?.filter { it.startsWith(annotationPrefix) }
|
||||
|
||||
Reference in New Issue
Block a user