diff options
Diffstat (limited to 'Scripts/main.js')
| -rw-r--r-- | Scripts/main.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/Scripts/main.js b/Scripts/main.js index 76bd816..1058dfe 100644 --- a/Scripts/main.js +++ b/Scripts/main.js | |||
| @@ -609,16 +609,12 @@ class ZigTaskAssistant { | |||
| 609 | return this.resolveBuildRunAction(config, cwd); | 609 | return this.resolveBuildRunAction(config, cwd); |
| 610 | case "build-run-terminal": | 610 | case "build-run-terminal": |
| 611 | return this.resolveBuildRunTerminalAction(config, cwd); | 611 | return this.resolveBuildRunTerminalAction(config, cwd); |
| 612 | case "build-test": | ||
| 613 | return this.resolveBuildTestAction(config, cwd); | ||
| 614 | case "current-file-run": | 612 | case "current-file-run": |
| 615 | return this.resolveCurrentFileRunAction(); | 613 | return this.resolveCurrentFileRunAction(); |
| 616 | case "current-file-clean": | 614 | case "current-file-clean": |
| 617 | return this.resolveCurrentFileCleanAction(); | 615 | return this.resolveCurrentFileCleanAction(); |
| 618 | case "debug": | 616 | case "debug": |
| 619 | return this.resolveDebugAction(config, cwd); | 617 | return this.resolveDebugAction(config, cwd); |
| 620 | case "file-test": | ||
| 621 | return this.resolveFileTestAction(config, cwd); | ||
| 622 | default: | 618 | default: |
| 623 | return null; | 619 | return null; |
| 624 | } | 620 | } |
| @@ -738,30 +734,6 @@ class ZigTaskAssistant { | |||
| 738 | }); | 734 | }); |
| 739 | } | 735 | } |
| 740 | 736 | ||
| 741 | async resolveBuildTestAction(config, cwd) { | ||
| 742 | const zigPath = await resolveExecutable(CONFIG_KEYS.zigPath, "zig"); | ||
| 743 | if (!zigPath) { | ||
| 744 | nova.workspace.showWarningMessage( | ||
| 745 | localizedText( | ||
| 746 | "warning.zig.not_found", | ||
| 747 | "Zig was not found. Install it or set a Zig executable path in Zig extension settings." | ||
| 748 | ) | ||
| 749 | ); | ||
| 750 | return null; | ||
| 751 | } | ||
| 752 | |||
| 753 | const step = | ||
| 754 | getTaskConfigValue(config, "testStep") || getTaskConfigValue(config, "step") || "test"; | ||
| 755 | const args = ["build", ...getTaskArgs(config, "buildArgs"), step]; | ||
| 756 | const testArgs = getTaskArgs(config, "testArgs"); | ||
| 757 | |||
| 758 | if (testArgs.length > 0) { | ||
| 759 | args.push("--", ...testArgs); | ||
| 760 | } | ||
| 761 | |||
| 762 | return this.createAction(zigPath, args, cwd); | ||
| 763 | } | ||
| 764 | |||
| 765 | async resolveCurrentFileRunAction() { | 737 | async resolveCurrentFileRunAction() { |
| 766 | const zigPath = await resolveExecutable(CONFIG_KEYS.zigPath, "zig"); | 738 | const zigPath = await resolveExecutable(CONFIG_KEYS.zigPath, "zig"); |
| 767 | if (!zigPath) { | 739 | if (!zigPath) { |
| @@ -854,36 +826,6 @@ class ZigTaskAssistant { | |||
| 854 | 826 | ||
| 855 | return action; | 827 | return action; |
| 856 | } | 828 | } |
| 857 | |||
| 858 | async resolveFileTestAction(config, cwd) { | ||
| 859 | const zigPath = await resolveExecutable(CONFIG_KEYS.zigPath, "zig"); | ||
| 860 | if (!zigPath) { | ||
| 861 | nova.workspace.showWarningMessage( | ||
| 862 | localizedText( | ||
| 863 | "warning.zig.not_found", | ||
| 864 | "Zig was not found. Install it or set a Zig executable path in Zig extension settings." | ||
| 865 | ) | ||
| 866 | ); | ||
| 867 | return null; | ||
| 868 | } | ||
| 869 | |||
| 870 | const configuredPath = getTaskConfigValue(config, "filePath"); | ||
| 871 | const filePath = configuredPath | ||
| 872 | ? resolveWorkspaceRelativePath(configuredPath) | ||
| 873 | : activeZigFilePath(); | ||
| 874 | |||
| 875 | if (!filePath) { | ||
| 876 | nova.workspace.showWarningMessage( | ||
| 877 | localizedText( | ||
| 878 | "warning.file_test.choose_file", | ||
| 879 | "Choose a Zig file for this task or focus a Zig editor before running Zig File Test." | ||
| 880 | ) | ||
| 881 | ); | ||
| 882 | return null; | ||
| 883 | } | ||
| 884 | |||
| 885 | return this.createAction(zigPath, ["test", filePath, ...getTaskArgs(config, "zigArgs")], cwd); | ||
| 886 | } | ||
| 887 | } | 829 | } |
| 888 | 830 | ||
| 889 | class ZigIssueAssistant { | 831 | class ZigIssueAssistant { |
