Skip to content

Commit cda9afe

Browse files
committed
Fix review comment
1 parent a9f5aa8 commit cda9afe

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function register(ctx: WorkspaceContext): vscode.Disposable[] {
150150
),
151151
vscode.commands.registerCommand(Commands.PLAY, async target => {
152152
const folder = ctx.currentFolder;
153-
if (!folder) {
153+
if (!folder || !target) {
154154
return false;
155155
}
156156
return await runPlayground(folder, ctx.tasks, target);

src/commands/runPlayground.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ export interface WorkspacePlaygroundItem extends PlaygroundItem {
3838
export async function runPlayground(
3939
folderContext: FolderContext,
4040
tasks: TaskManager,
41-
item?: PlaygroundItem
41+
item: PlaygroundItem
4242
) {
43-
if (!item) {
44-
return false;
45-
}
4643
const id = item.label ?? item.id;
4744
const task = createSwiftTask(
4845
["play", id],

0 commit comments

Comments
 (0)