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

Commit1572c7a

Browse files
authored
fix: Cannot show description page (LeetCode-OpenSource#345)
1 parent123d95b commit1572c7a

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

‎src/commands/show.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ import { leetCodeSolutionProvider } from "../webview/leetCodeSolutionProvider";
2020
import*aslistfrom"./list";
2121

2222
exportasyncfunctionpreviewProblem(input:IProblem|vscode.Uri,isSideMode:boolean=false):Promise<void>{
23-
letnode:LeetCodeNode;
24-
if(inputinstanceofLeetCodeNode){
25-
node=input;
26-
}elseif(inputinstanceofvscode.Uri){
23+
letnode:IProblem;
24+
if(inputinstanceofvscode.Uri){
2725
constactiveFilePath:string=input.fsPath;
2826
constid:string=awaitgetNodeIdFromFile(activeFilePath);
2927
if(!id){
3028
vscode.window.showErrorMessage(`Failed to resolve the problem id from file:${activeFilePath}.`);
3129
return;
3230
}
33-
constcachedNode:LeetCodeNode|undefined=explorerNodeManager.getNodeById(id);
31+
constcachedNode:IProblem|undefined=explorerNodeManager.getNodeById(id);
3432
if(!cachedNode){
3533
vscode.window.showErrorMessage(`Failed to resolve the problem with id:${id}.`);
3634
return;
@@ -39,8 +37,7 @@ export async function previewProblem(input: IProblem | vscode.Uri, isSideMode: b
3937
// Move the preview page aside if it's triggered from Code Lens
4038
isSideMode=true;
4139
}else{
42-
vscode.window.showErrorMessage("Invalid input to fetch the preview data.");
43-
return;
40+
node=input;
4441
}
4542

4643
constdescString:string=awaitleetCodeExecutor.getDescription(node.id);

‎src/webview/leetCodePreviewProvider.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
2222
this.node=node;
2323
this.sideMode=isSideMode;
2424
this.showWebviewInternal();
25-
if(this.sideMode){
26-
this.hideSideBar();// For better view area
27-
}
25+
// Comment out this operation since it sometimes may cause the webview become empty.
26+
// Waiting for the progress of the VS Code side issue: https://github.com/microsoft/vscode/issues/3742
27+
// if (this.sideMode) {
28+
// this.hideSideBar(); // For better view area
29+
// }
2830
}
2931

3032
protectedgetWebviewOption():ILeetCodeWebviewOption{
@@ -134,10 +136,10 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
134136
}
135137
}
136138

137-
privateasynchideSideBar():Promise<void>{
138-
awaitcommands.executeCommand("workbench.action.focusSideBar");
139-
awaitcommands.executeCommand("workbench.action.toggleSidebarVisibility");
140-
}
139+
//private async hideSideBar(): Promise<void> {
140+
// await commands.executeCommand("workbench.action.focusSideBar");
141+
// await commands.executeCommand("workbench.action.toggleSidebarVisibility");
142+
//}
141143

142144
privateparseDescription(descString:string,problem:IProblem):IDescription{
143145
const[

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp