diff --git a/CHANGELOG.md b/CHANGELOG.md index 382ffc9c..6e52f9ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [0.1.1] ### Fixed - Fixed a bug in LeetCode Explorer [(#3)](https://github.com/jdneo/vscode-leetcode/issues/3) +- Remove the show problem command from command palette [(#4)](https://github.com/jdneo/vscode-leetcode/issues/4) ## [0.1.0] ### Added diff --git a/package.json b/package.json index b944410c..1038f250 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-leetcode", "displayName": "LeetCode", "description": "Solve LeetCode problems in VS Code", - "version": "0.1.0", + "version": "0.1.1", "author": "Sheng Chen", "publisher": "shengchen", "icon": "resources/LeetCode.png", diff --git a/src/commands/session.ts b/src/commands/session.ts index 2cc4834b..5f767d2d 100644 --- a/src/commands/session.ts +++ b/src/commands/session.ts @@ -70,7 +70,7 @@ async function parseSessionsToPicks(p: Promise): Promise { const session: string | undefined = await vscode.window.showInputBox({ prompt: "Enter the new session name.", - validateInput: (s: string) => s.trim() ? undefined : "Session name must not be empty", + validateInput: (s: string) => s && s.trim() ? undefined : "Session name must not be empty", }); if (!session) { return; diff --git a/src/commands/show.ts b/src/commands/show.ts index 32265b71..2f0cfffd 100644 --- a/src/commands/show.ts +++ b/src/commands/show.ts @@ -14,7 +14,7 @@ export async function showProblem(channel: vscode.OutputChannel, node?: LeetCode if (!node) { return; } - await showProblemInternal(channel, node.id.split(".")[1]); + await showProblemInternal(channel, node.id); } export async function searchProblem(channel: vscode.OutputChannel): Promise { diff --git a/src/leetCodeManager.ts b/src/leetCodeManager.ts index ee1ec44a..af73e882 100644 --- a/src/leetCodeManager.ts +++ b/src/leetCodeManager.ts @@ -55,7 +55,7 @@ class LeetCodeManager extends EventEmitter implements ILeetCodeManager { childProc.on("error", reject); const name: string | undefined = await vscode.window.showInputBox({ prompt: "Enter user name.", - validateInput: (s: string) => s.trim() ? undefined : "User name must not be empty", + validateInput: (s: string) => s && s.trim() ? undefined : "User name must not be empty", }); if (!name) { childProc.kill();