Skip to content

Commit 7390855

Browse files
feat: show stop icon and cancellation message when mcdev command is cancelled
Co-authored-by: JoernBerkefeld <[email protected]>
1 parent 7bd2ff2 commit 7390855

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/devtools/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,9 @@ class DevToolsExtension {
722722
getStatusBarTitle(iconName: string, name: string): string {
723723
// Get the status bar icon based on the icon name
724724
const statusBarIcon = EnumsExtension.StatusBarIcon[iconName as keyof typeof EnumsExtension.StatusBarIcon];
725-
return `$(${statusBarIcon}) ${name}`;
725+
// Codicon names consist only of letters, digits, and hyphens; emoji/unicode chars are used directly
726+
const iconText = /^[a-zA-Z0-9-]+$/.test(statusBarIcon) ? `$(${statusBarIcon})` : statusBarIcon;
727+
return `${iconText} ${name}`;
726728
}
727729

728730
/**
@@ -831,7 +833,16 @@ class DevToolsExtension {
831833
cancelToken
832834
);
833835
if (cancelToken.isCancellationRequested) {
834-
this.updateStatusBar(packageName, initialStatusBarTitle, "");
836+
this.writeLog(
837+
packageName,
838+
MessagesEditor.runningCommandCancelled,
839+
EnumsExtension.LoggerLevel.WARN
840+
);
841+
this.updateStatusBar(
842+
packageName,
843+
this.getStatusBarTitle("stop", packageName),
844+
""
845+
);
835846
resolveCommand(false);
836847
} else {
837848
executeOnResult(success, resolveCommand);

src/enums/extension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ enum StatusBarIcon {
3232
copytobu = "file-symlink-directory",
3333
info = "extensions-info-message",
3434
delete = "trash",
35-
clone = "copy"
35+
clone = "copy",
36+
stop = "✋"
3637
}
3738

3839
/**

src/messages/editor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const recommendedExtensions =
22
"There are some recommended extensions that can enhance your usage of SFMC DevTools. Would you like to install them?";
33
const runningCommand = "Running DevTools command...";
44
const runningCommandSuccess = "DevTools command has run successfully!";
5+
const runningCommandCancelled = "DevTools command was cancelled.";
56
const runningCommandFailure = "Oh no. Something went wrong while running DevTools Command...";
67
const credentialPrompt = "Please select the credential you would like to use:";
78
const businessUnitsPrompt = "Please select the business unit you would like to use:";
@@ -22,6 +23,7 @@ export {
2223
recommendedExtensions,
2324
runningCommand,
2425
runningCommandSuccess,
26+
runningCommandCancelled,
2527
runningCommandFailure,
2628
credentialPrompt,
2729
businessUnitsPrompt,

0 commit comments

Comments
 (0)