Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"@modelcontextprotocol/sdk": "^1.26.0",
"@types/express": "^5.0.3",
"express": "^5.2.1",
"jsonc-parser": "^3.3.1",
"zod": "^3.25.76"
},
"devDependencies": {
Expand Down
7 changes: 0 additions & 7 deletions src/debuggingExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ export class DebuggingExecutor implements IDebuggingExecutor {
config: vscode.DebugConfiguration
): Promise<boolean> {
try {
if (config.type === 'coreclr') {
// Open the specific test file instead of the workspace folder
const testFileUri = vscode.Uri.file(config.program);
await vscode.commands.executeCommand('vscode.open', testFileUri);
vscode.commands.executeCommand('testing.debugCurrentFile');
return true;
}
const workspaceFolder = vscode.workspace.getWorkspaceFolder(vscode.Uri.file(workingDirectory));
return await vscode.debug.startDebugging(workspaceFolder, config);
} catch (error) {
Expand Down
16 changes: 6 additions & 10 deletions src/utils/debugConfigurationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as vscode from 'vscode';
import * as path from 'path';
import * as fs from 'fs';
import * as jsonc from 'jsonc-parser';

/**
* Interface for configuration management operations
Expand Down Expand Up @@ -43,11 +44,8 @@ export class DebugConfigurationManager implements IDebugConfigurationManager {
const launchJsonDoc = await vscode.workspace.openTextDocument(launchJsonPath);
const launchJsonContent = launchJsonDoc.getText();

// Parse the JSON (removing comments and trailing commas first)
let cleanJson = launchJsonContent.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
// Remove trailing commas before closing brackets/braces
cleanJson = cleanJson.replace(/,(\s*[}\]])/g, '$1');
const launchConfig = JSON.parse(cleanJson);
// Parse JSONC (JSON with comments and trailing commas)
const launchConfig = jsonc.parse(launchJsonContent);

if (launchConfig.configurations && Array.isArray(launchConfig.configurations) && launchConfig.configurations.length > 0) {
// If a specific configuration name is provided, find it
Expand Down Expand Up @@ -150,6 +148,7 @@ export class DebugConfigurationManager implements IDebugConfigurationManager {
'.tsx': 'node',
'.java': 'java',
'.cs': 'coreclr',
'.csproj': 'coreclr',
'.cpp': 'cppdbg',
'.cc': 'cppdbg',
'.c': 'cppdbg',
Expand Down Expand Up @@ -259,11 +258,8 @@ export class DebugConfigurationManager implements IDebugConfigurationManager {
const launchJsonDoc = await vscode.workspace.openTextDocument(launchJsonPath);
const launchJsonContent = launchJsonDoc.getText();

// Parse the JSON (removing comments and trailing commas first)
let cleanJson = launchJsonContent.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
// Remove trailing commas before closing brackets/braces
cleanJson = cleanJson.replace(/,(\s*[}\]])/g, '$1');
const launchConfig = JSON.parse(cleanJson);
// Parse JSONC (JSON with comments and trailing commas)
const launchConfig = jsonc.parse(launchJsonContent);

if (launchConfig.configurations && Array.isArray(launchConfig.configurations)) {
return launchConfig.configurations.map((config: any) => config.name || 'Unnamed Configuration');
Expand Down