Skip to content

Commit 8af0f15

Browse files
committed
new command : show leetcode problems
1 parent a4df16d commit 8af0f15

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/extension.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,19 @@ int main() {
402402
}
403403
);
404404

405+
// Command: Show LeetCode Problem Links
406+
const showLeetCodeProblemLinksCommand = vscode.commands.registerCommand(
407+
'leetcode-cph-helper-by-ashish.showLeetCodeProblemLinks',
408+
async () => {
409+
const problemLinksFilePath = path.join(context.extensionPath, 'leetcode_problems_link.txt');
410+
// Open the file in the editor
411+
const document = await vscode.workspace.openTextDocument(problemLinksFilePath);
412+
await vscode.window.showTextDocument(document);
413+
}
414+
);
415+
405416
// Register commands in context
406-
context.subscriptions.push(fetchCommand, getIOFileDirectoryCommand, getSolutionFileDirectoryCommand, writeSolutionFileCommand, runCommand);
417+
context.subscriptions.push(fetchCommand,showLeetCodeProblemLinksCommand, getIOFileDirectoryCommand, getSolutionFileDirectoryCommand, writeSolutionFileCommand, runCommand);
407418
const commandTreeDataProvider = new CommandTreeDataProvider();
408419
vscode.window.registerTreeDataProvider('leetcodeHelperCommands', commandTreeDataProvider);
409420

0 commit comments

Comments
 (0)