diff --git a/src/extension.ts b/src/extension.ts index f3ab4b5..6b96ccd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -108,17 +108,17 @@ export function activate(context: vscode.ExtensionContext) { quickPick.onDidAccept(async () => { const selection = quickPick.selectedItems[0]; if (selection) { - const name = selection.label.toLowerCase(); + const name = selection.label.toLowerCase().replace(' ', '-'); treeDataProvider.testSummary = undefined; treeDataProvider.testResults = []; treeDataProvider.blunders = []; treeDataProvider.refresh(); - const runFilePath = path.join(speedCodePath, name + ".js"); + const runFilePath = path.join(speedCodePath, name.replace('-', '_') + ".js"); fs.writeFileSync(runFilePath, ""); openAndFocusFile(runFilePath); const response = await fetch( - `https://raw.githubusercontent.com/SpeedCodeHQ/problems/refs/heads/main/${name}.json` + `https://raw.githubusercontent.com/SpeedCodeHQ/problems/refs/heads/main/problems/${name}.json` ); if (!response.ok) { diff --git a/src/utils.ts b/src/utils.ts index f2ce675..f57249c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -export const problems = ["Palindrome"]; +export const problems = ["Two Sum", "Palindrome", "Fibonacci", "Factorial", "Find Missing Number", "Anagram", "Reverse Words In a Sentence"]; export function format(timeSeconds: number): string { if (timeSeconds > 86400) {