Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2a11e1b

Browse files
committed
fix session bug
1 parent9b7eb3a commit2a11e1b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

‎src/commands/list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ export async function listProblems(): Promise<IProblem[]> {
2323
constproblems:IProblem[]=[];
2424
constlines:string[]=result.split("\n");
2525
constreg:RegExp=/(.?)\s*\[\s*(\d*)\]\s*(.*)\s*(Easy|Medium|Hard)\s*\((\s*\d+\.\d+%)\)/;
26-
for(constlineoflines.map((l:string)=>l.trim()).filter(Boolean)){
26+
for(constlineoflines){
2727
constmatch:RegExpMatchArray|null=line.match(reg);
2828
if(match&&match.length===6){
2929
problems.push({
30-
solved:!!match[1],
30+
solved:!!(match[1].trim()),
3131
id:match[2].trim(),
3232
name:match[3].trim(),
3333
difficulty:match[4].trim(),

‎src/commands/session.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export async function getSessionList(): Promise<ISession[]> {
1616
constlines:string[]=result.split("\n");
1717
constsessions:ISession[]=[];
1818
constreg:RegExp=/(.?)\s*(\d+)\s+(.*)\s+(\d+\(\s*\d+\.\d+%\))\s+(\d+\(\s*\d+\.\d+%\))/;
19-
for(constlineoflines.map((l:string)=>l.trim()).filter(Boolean)){
19+
for(constlineoflines){
2020
constmatch:RegExpMatchArray|null=line.match(reg);
2121
if(match&&match.length===6){
2222
sessions.push({
23-
active:!!match[1],
23+
active:!!(match[1].trim()),
2424
id:match[2].trim(),
2525
name:match[3].trim(),
2626
acQuestions:match[4].trim(),
@@ -43,6 +43,7 @@ export async function selectSession(): Promise<void> {
4343
try{
4444
awaitcp.executeCommand("node",[leetCodeBinaryPath,"session","-e",choice.value]);
4545
vscode.window.showInformationMessage(`Successfully switched to session '${choice.label}'.`);
46+
awaitvscode.commands.executeCommand("leetcode.refreshExplorer");
4647
}catch(error){
4748
awaitpromptForOpenOutputChannel("Failed to switch session. Please open the output channel for details",DialogType.error);
4849
}
@@ -59,6 +60,7 @@ async function parseSessionsToPicks(p: Promise<ISession[]>): Promise<Array<IQuic
5960
picks.push({
6061
label:"$(plus) Create a new session",
6162
description:"",
63+
detail:"Click this item to create a new session",
6264
value:":createNewSession",
6365
});
6466
resolve(picks);
@@ -75,6 +77,7 @@ export async function createSession(): Promise<void> {
7577
}
7678
try{
7779
awaitcp.executeCommand("node",[leetCodeBinaryPath,"session","-c",session]);
80+
vscode.window.showInformationMessage("New session created, you can switch to it by clicking the status bar.");
7881
}catch(error){
7982
awaitpromptForOpenOutputChannel("Failed to create session. Please open the output channel for details",DialogType.error);
8083
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp