From 794efb6c2bccd6f1e182f96c1ccfb99452e7c422 Mon Sep 17 00:00:00 2001 From: "sheche@microsoft.com" Date: Wed, 8 May 2019 19:25:56 +0800 Subject: [PATCH] Add problem name into the solution output --- .vscode/launch.json | 30 ++++++++++++++++++++++++++++++ lib/plugins/solution.discuss.js | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..c4d2ab92 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "program": "${workspaceFolder}/bin/leetcode", + "args": ["show", "1", "--solution"] + }, + { + "type": "node", + "request": "launch", + "name": "Mocha Tests", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "-u", + "tdd", + "--timeout", + "999999", + "--colors", + "${workspaceFolder}/test/plugins" + ], + "internalConsoleOptions": "openOnSessionStart" + }, + ] +} \ No newline at end of file diff --git a/lib/plugins/solution.discuss.js b/lib/plugins/solution.discuss.js index e78b90af..a161aa50 100644 --- a/lib/plugins/solution.discuss.js +++ b/lib/plugins/solution.discuss.js @@ -83,6 +83,8 @@ plugin.getProblem = function(problem, cb) { var link = URL_DISCUSS.replace('$slug', problem.slug).replace('$id', solution.id); var content = solution.post.content.replace(/\\n/g, '\n').replace(/\\t/g, '\t'); + log.info(); + log.info(problem.name); log.info(); log.info(solution.title); log.info();