Show filePattern in settings for new script definitions if present
This commit is contained in:
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -40,6 +40,7 @@ class KotlinScriptDefinitionsModel private constructor(definitions: MutableList<
|
||||
override fun valueOf(item: KotlinScriptDefinitionsModelDescriptor): String {
|
||||
val definition = item.definition
|
||||
return definition.asLegacyOrNull<KotlinScriptDefinitionFromAnnotatedTemplate>()?.scriptFilePattern?.pattern
|
||||
?: (definition as? ScriptDefinition.FromConfigurations)?.filePathPattern
|
||||
?: "." + definition.fileExtension
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ abstract class ScriptDefinition : UserDataHolderBase() {
|
||||
)
|
||||
}
|
||||
|
||||
private val filePathPattern by lazy {
|
||||
val filePathPattern by lazy {
|
||||
compilationConfiguration[ScriptCompilationConfiguration.filePathPattern]?.takeIf { it.isNotBlank() }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user