fix: new zig file action icon and location
This commit is contained in:
parent
0636ba09f6
commit
990563d70a
19 changed files with 26 additions and 20 deletions
|
@ -17,6 +17,10 @@ Changelog structure reference:
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Renamed Zig new file task to "Zig File" and moved to the file creation group
|
||||||
|
|
||||||
## [20.0.3]
|
## [20.0.3]
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ZigConfigTypeBinary: ConfigurationTypeBase(
|
||||||
IDENTIFIER,
|
IDENTIFIER,
|
||||||
ZigDebugBundle.message("configuration.binary.name"),
|
ZigDebugBundle.message("configuration.binary.name"),
|
||||||
ZigDebugBundle.message("configuration.binary.description"),
|
ZigDebugBundle.message("configuration.binary.description"),
|
||||||
Icons.ZIG
|
Icons.Zig
|
||||||
) {
|
) {
|
||||||
init {
|
init {
|
||||||
addFactory(ConfigFactoryBinary(this))
|
addFactory(ConfigFactoryBinary(this))
|
||||||
|
|
|
@ -27,6 +27,8 @@ import org.jetbrains.annotations.NonNls
|
||||||
|
|
||||||
@NonNls
|
@NonNls
|
||||||
object Icons {
|
object Icons {
|
||||||
val ZIG = IconLoader.getIcon("/icons/zig.svg", Icons::class.java)
|
@JvmField
|
||||||
val ZON = IconLoader.getIcon("/icons/zon.svg", Icons::class.java)
|
val Zig = IconLoader.getIcon("/icons/zig.svg", Icons::class.java)
|
||||||
|
@JvmField
|
||||||
|
val Zon = IconLoader.getIcon("/icons/zon.svg", Icons::class.java)
|
||||||
}
|
}
|
|
@ -31,7 +31,7 @@ import com.intellij.psi.PsiDirectory
|
||||||
class ZigNewFileAction: CreateFileFromTemplateAction() {
|
class ZigNewFileAction: CreateFileFromTemplateAction() {
|
||||||
override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) {
|
override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) {
|
||||||
builder.setTitle("Zig File")
|
builder.setTitle("Zig File")
|
||||||
.addKind("Empty file", Icons.ZIG, "blank_zig_file")
|
.addKind("Empty file", Icons.Zig, "blank_zig_file")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?): String {
|
override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?): String {
|
||||||
|
|
|
@ -64,7 +64,7 @@ abstract class ZigProfileState<T: ZigExecConfig<T>> (
|
||||||
|
|
||||||
// TODO remove this check once JetBrains implements colored terminal in the debugger
|
// TODO remove this check once JetBrains implements colored terminal in the debugger
|
||||||
// https://youtrack.jetbrains.com/issue/CPP-11622/ANSI-color-codes-not-honored-in-Debug-Run-Configuration-output-window
|
// https://youtrack.jetbrains.com/issue/CPP-11622/ANSI-color-codes-not-honored-in-Debug-Run-Configuration-output-window
|
||||||
val cli = if (configuration.emulateTerminal() && !debug) PtyCommandLine() else GeneralCommandLine()
|
val cli = if (configuration.emulateTerminal() && !debug) PtyCommandLine().withConsoleMode(true).withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE) else GeneralCommandLine()
|
||||||
cli.exePath = zigExePath.pathString
|
cli.exePath = zigExePath.pathString
|
||||||
workingDir.path?.let { cli.withWorkingDirectory(it) }
|
workingDir.path?.let { cli.withWorkingDirectory(it) }
|
||||||
cli.charset = Charsets.UTF_8
|
cli.charset = Charsets.UTF_8
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ZigConfigTypeBuild : ConfigurationTypeBase(
|
||||||
IDENTIFIER,
|
IDENTIFIER,
|
||||||
ZigBrainsBundle.message("configuration.build.name"),
|
ZigBrainsBundle.message("configuration.build.name"),
|
||||||
ZigBrainsBundle.message("configuration.build.description"),
|
ZigBrainsBundle.message("configuration.build.description"),
|
||||||
Icons.ZIG
|
Icons.Zig
|
||||||
) {
|
) {
|
||||||
init {
|
init {
|
||||||
addFactory(ConfigFactoryRun(this))
|
addFactory(ConfigFactoryRun(this))
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ZigConfigTypeRun : ConfigurationTypeBase(
|
||||||
IDENTIFIER,
|
IDENTIFIER,
|
||||||
ZigBrainsBundle.message("configuration.run.name"),
|
ZigBrainsBundle.message("configuration.run.name"),
|
||||||
ZigBrainsBundle.message("configuration.run.description"),
|
ZigBrainsBundle.message("configuration.run.description"),
|
||||||
Icons.ZIG
|
Icons.Zig
|
||||||
) {
|
) {
|
||||||
init {
|
init {
|
||||||
addFactory(ConfigFactoryRun(this))
|
addFactory(ConfigFactoryRun(this))
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ZigConfigTypeTest : ConfigurationTypeBase(
|
||||||
IDENTIFIER,
|
IDENTIFIER,
|
||||||
ZigBrainsBundle.message("configuration.test.name"),
|
ZigBrainsBundle.message("configuration.test.name"),
|
||||||
ZigBrainsBundle.message("configuration.test.description"),
|
ZigBrainsBundle.message("configuration.test.description"),
|
||||||
Icons.ZIG
|
Icons.Zig
|
||||||
) {
|
) {
|
||||||
init {
|
init {
|
||||||
addFactory(ConfigFactoryRun(this))
|
addFactory(ConfigFactoryRun(this))
|
||||||
|
|
|
@ -40,6 +40,6 @@ object ZigModuleType: ModuleType<ZigModuleBuilder>("com.falsepattern.zigbrains.z
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getNodeIcon(isOpened: Boolean): Icon {
|
override fun getNodeIcon(isOpened: Boolean): Icon {
|
||||||
return Icons.ZIG
|
return Icons.Zig
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,7 +23,6 @@
|
||||||
package com.falsepattern.zigbrains.project.newproject
|
package com.falsepattern.zigbrains.project.newproject
|
||||||
|
|
||||||
import com.falsepattern.zigbrains.Icons
|
import com.falsepattern.zigbrains.Icons
|
||||||
import com.falsepattern.zigbrains.shared.coroutine.runModalOrBlocking
|
|
||||||
import com.falsepattern.zigbrains.shared.zigCoroutineScope
|
import com.falsepattern.zigbrains.shared.zigCoroutineScope
|
||||||
import com.intellij.facet.ui.ValidationResult
|
import com.intellij.facet.ui.ValidationResult
|
||||||
import com.intellij.ide.util.projectWizard.AbstractNewProjectStep
|
import com.intellij.ide.util.projectWizard.AbstractNewProjectStep
|
||||||
|
@ -44,7 +43,7 @@ class ZigDirectoryProjectGenerator: DirectoryProjectGenerator<ZigProjectConfigur
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLogo(): Icon {
|
override fun getLogo(): Icon {
|
||||||
return Icons.ZIG
|
return Icons.Zig
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createPeer(): ProjectGeneratorPeer<ZigProjectConfigurationData> {
|
override fun createPeer(): ProjectGeneratorPeer<ZigProjectConfigurationData> {
|
||||||
|
|
|
@ -37,7 +37,7 @@ class ZigNewProjectWizard: LanguageGeneratorNewProjectWizard {
|
||||||
override val name: String
|
override val name: String
|
||||||
get() = "Zig"
|
get() = "Zig"
|
||||||
override val icon: Icon
|
override val icon: Icon
|
||||||
get() = Icons.ZIG
|
get() = Icons.Zig
|
||||||
override val ordinal: Int
|
override val ordinal: Int
|
||||||
get() = 900
|
get() = 900
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ import javax.swing.tree.TreePath
|
||||||
|
|
||||||
class BuildToolWindowContext(private val project: Project): Disposable {
|
class BuildToolWindowContext(private val project: Project): Disposable {
|
||||||
val rootNode: DefaultMutableTreeNode = DefaultMutableTreeNode(BaseNodeDescriptor<Any>(project, project.name, AllIcons.Actions.ProjectDirectory))
|
val rootNode: DefaultMutableTreeNode = DefaultMutableTreeNode(BaseNodeDescriptor<Any>(project, project.name, AllIcons.Actions.ProjectDirectory))
|
||||||
private val buildZig: DefaultMutableTreeNode = DefaultMutableTreeNode(BaseNodeDescriptor<Any>(project, ZigBrainsBundle.message("build.tool.window.tree.steps.label"), Icons.ZIG))
|
private val buildZig: DefaultMutableTreeNode = DefaultMutableTreeNode(BaseNodeDescriptor<Any>(project, ZigBrainsBundle.message("build.tool.window.tree.steps.label"), Icons.Zig))
|
||||||
init {
|
init {
|
||||||
rootNode.add(buildZig)
|
rootNode.add(buildZig)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ import javax.swing.Icon
|
||||||
sealed class ZigProjectTemplate(
|
sealed class ZigProjectTemplate(
|
||||||
@ListItem val name: String,
|
@ListItem val name: String,
|
||||||
val isBinary: Boolean,
|
val isBinary: Boolean,
|
||||||
val icon: Icon = Icons.ZIG
|
val icon: Icon = Icons.Zig
|
||||||
) {
|
) {
|
||||||
abstract fun fileTemplates(): Map<String, String>
|
abstract fun fileTemplates(): Map<String, String>
|
||||||
}
|
}
|
|
@ -60,7 +60,7 @@ class ZigSyntheticLibrary(val project: Project) : SyntheticLibrary(), ItemPresen
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getIcon(unused: Boolean): Icon {
|
override fun getIcon(unused: Boolean): Icon {
|
||||||
return Icons.ZIG
|
return Icons.Zig
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSourceRoots(): Collection<VirtualFile> {
|
override fun getSourceRoots(): Collection<VirtualFile> {
|
||||||
|
|
|
@ -33,5 +33,5 @@ object ZigFileType : LanguageFileType(ZigLanguage) {
|
||||||
|
|
||||||
override fun getDefaultExtension() = "zig"
|
override fun getDefaultExtension() = "zig"
|
||||||
|
|
||||||
override fun getIcon() = Icons.ZIG
|
override fun getIcon() = Icons.Zig
|
||||||
}
|
}
|
|
@ -38,7 +38,7 @@ class ZigColorSettingsPage: ColorSettingsPage {
|
||||||
|
|
||||||
override fun getDisplayName() = ZigBrainsBundle.message("configurable.name.zig-color-settings-page")
|
override fun getDisplayName() = ZigBrainsBundle.message("configurable.name.zig-color-settings-page")
|
||||||
|
|
||||||
override fun getIcon() = Icons.ZIG
|
override fun getIcon() = Icons.Zig
|
||||||
|
|
||||||
override fun getHighlighter() = ZigSyntaxHighlighter()
|
override fun getHighlighter() = ZigSyntaxHighlighter()
|
||||||
|
|
||||||
|
|
|
@ -33,5 +33,5 @@ object ZonFileType: LanguageFileType(ZonLanguage) {
|
||||||
|
|
||||||
override fun getDefaultExtension() = "zon"
|
override fun getDefaultExtension() = "zon"
|
||||||
|
|
||||||
override fun getIcon() = Icons.ZON
|
override fun getIcon() = Icons.Zon
|
||||||
}
|
}
|
|
@ -35,7 +35,7 @@ class ZonColorSettingsPage: ColorSettingsPage {
|
||||||
|
|
||||||
override fun getDisplayName() = ZigBrainsBundle.message("configurable.name.zon-color-settings-page")
|
override fun getDisplayName() = ZigBrainsBundle.message("configurable.name.zon-color-settings-page")
|
||||||
|
|
||||||
override fun getIcon() = Icons.ZON
|
override fun getIcon() = Icons.Zon
|
||||||
|
|
||||||
override fun getHighlighter() = ZonSyntaxHighlighter()
|
override fun getHighlighter() = ZonSyntaxHighlighter()
|
||||||
|
|
||||||
|
|
|
@ -187,8 +187,9 @@
|
||||||
<action
|
<action
|
||||||
id="zigbrains.file.new"
|
id="zigbrains.file.new"
|
||||||
class="com.falsepattern.zigbrains.project.actions.ZigNewFileAction"
|
class="com.falsepattern.zigbrains.project.actions.ZigNewFileAction"
|
||||||
|
icon="com.falsepattern.zigbrains.Icons.Zig"
|
||||||
>
|
>
|
||||||
<add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewFile"/>
|
<add-to-group group-id="NewGroup" anchor="after" relative-to-action="FileTemplateSeparatorGroup"/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
<!-- endregion Project -->
|
<!-- endregion Project -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue