in src/main/kotlin/org/jetbrains/tinygoplugin/services/CreateFileAction.kt [42:63]
override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) {
val tinyGoSettings = project.tinyGoConfiguration()
if (tinyGoSettings.sdk != nullSdk) {
if (!tinyGoSettings.sdk.isValid) {
Messages.showErrorDialog(
project,
message(TINYGO_TEMPLATES_NOT_FOUND_MESSAGE),
message(TINYGO_TEMPLATES_NOT_FOUND_TITLE)
)
notifyTinyGoNotConfigured(project, message(TINYGO_INVALID_SDK))
return
}
builder.setTitle(message(TINYGO_TEMPLATE_DIALOG_NAME))
val examples = availableExamples(project, tinyGoSettings.sdk.sdkRoot!!)
examples.files.forEach {
builder.addKind(it, TinyGoPluginIcons.TinyGoIcon, it)
}
examples.dirs.sorted().forEach {
builder.addKind(it, AllIcons.Nodes.Folder, it)
}
}
}