fix: new zig file action icon and location

This commit is contained in:
FalsePattern 2024-12-11 17:13:32 +01:00
parent 0636ba09f6
commit 990563d70a
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
19 changed files with 26 additions and 20 deletions

View file

@ -17,6 +17,10 @@ Changelog structure reference:
## [Unreleased]
### Fixed
- Renamed Zig new file task to "Zig File" and moved to the file creation group
## [20.0.3]
### Fixed

View file

@ -33,7 +33,7 @@ class ZigConfigTypeBinary: ConfigurationTypeBase(
IDENTIFIER,
ZigDebugBundle.message("configuration.binary.name"),
ZigDebugBundle.message("configuration.binary.description"),
Icons.ZIG
Icons.Zig
) {
init {
addFactory(ConfigFactoryBinary(this))

View file

@ -27,6 +27,8 @@ import org.jetbrains.annotations.NonNls
@NonNls
object Icons {
val ZIG = IconLoader.getIcon("/icons/zig.svg", Icons::class.java)
val ZON = IconLoader.getIcon("/icons/zon.svg", Icons::class.java)
@JvmField
val Zig = IconLoader.getIcon("/icons/zig.svg", Icons::class.java)
@JvmField
val Zon = IconLoader.getIcon("/icons/zon.svg", Icons::class.java)
}

View file

@ -31,7 +31,7 @@ import com.intellij.psi.PsiDirectory
class ZigNewFileAction: CreateFileFromTemplateAction() {
override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) {
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 {

View file

@ -64,7 +64,7 @@ abstract class ZigProfileState<T: ZigExecConfig<T>> (
// 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
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
workingDir.path?.let { cli.withWorkingDirectory(it) }
cli.charset = Charsets.UTF_8

View file

@ -33,7 +33,7 @@ class ZigConfigTypeBuild : ConfigurationTypeBase(
IDENTIFIER,
ZigBrainsBundle.message("configuration.build.name"),
ZigBrainsBundle.message("configuration.build.description"),
Icons.ZIG
Icons.Zig
) {
init {
addFactory(ConfigFactoryRun(this))

View file

@ -33,7 +33,7 @@ class ZigConfigTypeRun : ConfigurationTypeBase(
IDENTIFIER,
ZigBrainsBundle.message("configuration.run.name"),
ZigBrainsBundle.message("configuration.run.description"),
Icons.ZIG
Icons.Zig
) {
init {
addFactory(ConfigFactoryRun(this))

View file

@ -33,7 +33,7 @@ class ZigConfigTypeTest : ConfigurationTypeBase(
IDENTIFIER,
ZigBrainsBundle.message("configuration.test.name"),
ZigBrainsBundle.message("configuration.test.description"),
Icons.ZIG
Icons.Zig
) {
init {
addFactory(ConfigFactoryRun(this))

View file

@ -40,6 +40,6 @@ object ZigModuleType: ModuleType<ZigModuleBuilder>("com.falsepattern.zigbrains.z
}
override fun getNodeIcon(isOpened: Boolean): Icon {
return Icons.ZIG
return Icons.Zig
}
}

View file

@ -23,7 +23,6 @@
package com.falsepattern.zigbrains.project.newproject
import com.falsepattern.zigbrains.Icons
import com.falsepattern.zigbrains.shared.coroutine.runModalOrBlocking
import com.falsepattern.zigbrains.shared.zigCoroutineScope
import com.intellij.facet.ui.ValidationResult
import com.intellij.ide.util.projectWizard.AbstractNewProjectStep
@ -44,7 +43,7 @@ class ZigDirectoryProjectGenerator: DirectoryProjectGenerator<ZigProjectConfigur
}
override fun getLogo(): Icon {
return Icons.ZIG
return Icons.Zig
}
override fun createPeer(): ProjectGeneratorPeer<ZigProjectConfigurationData> {

View file

@ -37,7 +37,7 @@ class ZigNewProjectWizard: LanguageGeneratorNewProjectWizard {
override val name: String
get() = "Zig"
override val icon: Icon
get() = Icons.ZIG
get() = Icons.Zig
override val ordinal: Int
get() = 900

View file

@ -65,7 +65,7 @@ import javax.swing.tree.TreePath
class BuildToolWindowContext(private val project: Project): Disposable {
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 {
rootNode.add(buildZig)
}

View file

@ -29,7 +29,7 @@ import javax.swing.Icon
sealed class ZigProjectTemplate(
@ListItem val name: String,
val isBinary: Boolean,
val icon: Icon = Icons.ZIG
val icon: Icon = Icons.Zig
) {
abstract fun fileTemplates(): Map<String, String>
}

View file

@ -60,7 +60,7 @@ class ZigSyntheticLibrary(val project: Project) : SyntheticLibrary(), ItemPresen
}
override fun getIcon(unused: Boolean): Icon {
return Icons.ZIG
return Icons.Zig
}
override fun getSourceRoots(): Collection<VirtualFile> {

View file

@ -33,5 +33,5 @@ object ZigFileType : LanguageFileType(ZigLanguage) {
override fun getDefaultExtension() = "zig"
override fun getIcon() = Icons.ZIG
override fun getIcon() = Icons.Zig
}

View file

@ -38,7 +38,7 @@ class ZigColorSettingsPage: ColorSettingsPage {
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()

View file

@ -33,5 +33,5 @@ object ZonFileType: LanguageFileType(ZonLanguage) {
override fun getDefaultExtension() = "zon"
override fun getIcon() = Icons.ZON
override fun getIcon() = Icons.Zon
}

View file

@ -35,7 +35,7 @@ class ZonColorSettingsPage: ColorSettingsPage {
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()

View file

@ -187,8 +187,9 @@
<action
id="zigbrains.file.new"
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>
</actions>
<!-- endregion Project -->