diff --git a/src/SwiftSnippets.ts b/src/SwiftSnippets.ts index 0685fc434..91a557f7e 100644 --- a/src/SwiftSnippets.ts +++ b/src/SwiftSnippets.ts @@ -87,24 +87,21 @@ export async function debugSnippetWithOptions( ctx.toolchain ); - try { - // queue build task and when it is complete run executable in the debugger - await folderContext.taskQueue - .queueOperation(new TaskOperation(snippetBuildTask)) - .then(result => { - if (result === 0) { - const snippetDebugConfig = createSnippetConfiguration( - snippetName, - folderContext - ); - return debugLaunchConfig( - folderContext.workspaceFolder, - snippetDebugConfig, - options - ); - } - }); - } catch { - // ignore error if task failed to run - } + // try { + // queue build task and when it is complete run executable in the debugger + await folderContext.taskQueue + .queueOperation(new TaskOperation(snippetBuildTask)) + .then(result => { + if (result === 0) { + const snippetDebugConfig = createSnippetConfiguration(snippetName, folderContext); + return debugLaunchConfig( + folderContext.workspaceFolder, + snippetDebugConfig, + options + ); + } + }); + // } catch { + // // ignore error if task failed to run + // } } diff --git a/test/integration-tests/SwiftSnippet.test.ts b/test/integration-tests/SwiftSnippet.test.ts index e94f69eb7..bfb9afa91 100644 --- a/test/integration-tests/SwiftSnippet.test.ts +++ b/test/integration-tests/SwiftSnippet.test.ts @@ -23,6 +23,7 @@ import { waitForDebugAdapterExit, waitUntilDebugSessionTerminates, } from "../utilities/debug"; +import { Version } from "../../src/utilities/version"; suite("SwiftSnippet Test Suite", () => { const uri = testAssetUri("defaultPackage/Snippets/hello.swift"); @@ -30,8 +31,11 @@ suite("SwiftSnippet Test Suite", () => { new vscode.SourceBreakpoint(new vscode.Location(uri, new vscode.Position(2, 0))), ]; - suiteSetup(async () => { - await folderContextPromise("defaultPackage"); + suiteSetup(async function () { + const folder = await folderContextPromise("defaultPackage"); + if (folder.workspaceContext.toolchain.swiftVersion.isLessThan(new Version(6, 0, 0))) { + this.skip(); + } await waitForNoRunningTasks(); // File needs to be open for command to be enabled