From 0af6849ff76388d78264edd680b7cf02f3084429 Mon Sep 17 00:00:00 2001 From: Subhash Arabhi Date: Fri, 25 Apr 2025 12:31:29 +0530 Subject: [PATCH] Updated commands for test request to get correct value for testRun in netbeans Added projectTestDebug --- vscode/src/commands/commands.ts | 1 + vscode/src/commands/debug.ts | 6 ++++++ vscode/src/views/TestViewController.ts | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/vscode/src/commands/commands.ts b/vscode/src/commands/commands.ts index f308b0d8..cbc8f56a 100644 --- a/vscode/src/commands/commands.ts +++ b/vscode/src/commands/commands.ts @@ -39,6 +39,7 @@ export const extCommands = { projectRun: appendPrefixToCommand('project.run'), projectDebug: appendPrefixToCommand('project.debug'), projectTest: appendPrefixToCommand('project.test'), + projectTestDebug: appendPrefixToCommand('project.test.debug'), packageTest: appendPrefixToCommand('package.test'), openStackTrace: appendPrefixToCommand('open.stacktrace'), workspaceSymbols: appendPrefixToCommand('workspace.symbols'), diff --git a/vscode/src/commands/debug.ts b/vscode/src/commands/debug.ts index 48c04593..dbed23c4 100644 --- a/vscode/src/commands/debug.ts +++ b/vscode/src/commands/debug.ts @@ -41,6 +41,9 @@ const projectDebug = async (node: any, launchConfiguration? : string) => { const projectTest = async (node: any, launchConfiguration? : string) => { return runDebug(true, true, getContextUri(node)?.toString() || '', undefined, launchConfiguration, true); } +const projectTestDebug = async (node: any, launchConfiguration? : string) => { + return runDebug(false, true, getContextUri(node)?.toString() || '', undefined, launchConfiguration, true); +} const packageTest = async (uri: any, launchConfiguration? : string) => { await runDebug(true, true, uri, undefined, launchConfiguration); } @@ -144,6 +147,9 @@ export const registerDebugCommands: ICommand[] = [ }, { command: extCommands.projectTest, handler: projectTest + }, { + command: extCommands.projectTestDebug, + handler: projectTestDebug }, { command: extCommands.packageTest, handler: packageTest diff --git a/vscode/src/views/TestViewController.ts b/vscode/src/views/TestViewController.ts index dad68086..d18e8e9a 100644 --- a/vscode/src/views/TestViewController.ts +++ b/vscode/src/views/TestViewController.ts @@ -69,7 +69,7 @@ export class NbTestAdapter { this.set(item, 'enqueued'); const idx = item.id.indexOf(':'); if (!cancellation.isCancellationRequested) { - await commands.executeCommand(request.profile?.kind === TestRunProfileKind.Debug ? extCommands.debugSingle : extCommands.runSingle, item.uri.toString(), idx < 0 ? undefined : item.id.slice(idx + 1)); + await commands.executeCommand(request.profile?.kind === TestRunProfileKind.Debug ? extCommands.debugTest : extCommands.runTest, item.uri.toString(), idx < 0 ? undefined : item.id.slice(idx + 1)); } } } @@ -77,7 +77,7 @@ export class NbTestAdapter { this.testController.items.forEach(item => this.set(item, 'enqueued')); for (let workspaceFolder of workspace.workspaceFolders || []) { if (!cancellation.isCancellationRequested) { - await commands.executeCommand(request.profile?.kind === TestRunProfileKind.Debug ? extCommands.debugTest : extCommands.runTest, workspaceFolder.uri.toString()); + await commands.executeCommand(request.profile?.kind === TestRunProfileKind.Debug ? extCommands.projectTestDebug : extCommands.projectTest, workspaceFolder.uri.toString()); } } }