Skip to content

Commit 20b1f0b

Browse files
Merge pull request #242 from gjsjohnmurray/fix-239
fix #239 'Studio Action "Changed Namespace" not supported' in Output
2 parents 43be9d6 + ffd65eb commit 20b1f0b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/commands/studio.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class StudioActions {
161161
});
162162
});
163163
case 3: // Run an EXE on the client.
164-
throw new Error("Not supported");
164+
throw new Error("processUserAction: Run EXE (Action=5) not supported");
165165
case 4: {
166166
// Insert the text in Target in the current document at the current selection point
167167
const editor = vscode.window.activeTextEditor;
@@ -170,7 +170,7 @@ class StudioActions {
170170
editBuilder.replace(editor.selection, target);
171171
});
172172
}
173-
return;
173+
break;
174174
}
175175
case 5: // Studio will open the documents listed in Target
176176
target.split(",").forEach((element) => {
@@ -207,7 +207,7 @@ class StudioActions {
207207
}
208208
});
209209
});
210-
return;
210+
break;
211211
case 6: // Display an alert dialog in Studio with the text from the Target variable.
212212
return vscode.window.showWarningMessage(target, { modal: true });
213213
case 7: // Display a dialog with a textbox and Yes/No/Cancel buttons.
@@ -222,8 +222,9 @@ class StudioActions {
222222
};
223223
});
224224
default:
225-
throw new Error("Not supported");
225+
throw new Error(`processUserAction: ${userAction} not supported`);
226226
}
227+
return Promise.resolve();
227228
}
228229

229230
private userAction(action, afterUserAction = false, answer = "", msg = "", type = 0): Thenable<void> {
@@ -247,7 +248,7 @@ class StudioActions {
247248
{
248249
cancellable: false,
249250
location: vscode.ProgressLocation.Notification,
250-
title: `Executing user action: ${action.label}`,
251+
title: `Executing ${afterUserAction ? "AfterUserAction" : "UserAction"}: ${action.label}`,
251252
},
252253
() => {
253254
return this.api
@@ -274,6 +275,7 @@ class StudioActions {
274275
.then(
275276
(actionToProcess) =>
276277
actionToProcess &&
278+
!afterUserAction &&
277279
this.processUserAction(actionToProcess).then((answer) =>
278280
answer && (answer.msg || answer.msg === "")
279281
? this.userAction(action, true, answer.answer, answer.msg, type)
@@ -431,6 +433,7 @@ export async function _contextMenu(sourceControl: boolean, node: PackageNode | C
431433
return studioActions && studioActions.getMenu(StudioMenuType.Context, sourceControl);
432434
}
433435

436+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
434437
export async function fireOtherStudioAction(action: OtherStudioAction, uri?: vscode.Uri, userAction?): Promise<void> {
435438
const studioActions = new StudioActions(uri);
436439
return studioActions && studioActions.fireOtherStudioAction(action, userAction);

0 commit comments

Comments
 (0)