Skip to content

Commit eef7106

Browse files
committed
change progress location from window to notification
1 parent ac20b6c commit eef7106

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"publisher": "shengchen",
88
"icon": "resources/LeetCode.png",
99
"engines": {
10-
"vscode": "^1.20.0"
10+
"vscode": "^1.23.0"
1111
},
1212
"repository": {
1313
"type": "git",

src/commands/show.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as vscode from "vscode";
55
import { LeetCodeNode } from "../leetCodeExplorer";
66
import { leetCodeManager } from "../leetCodeManager";
77
import { IQuickItemEx, languages, leetCodeBinaryPath, ProblemState } from "../shared";
8-
import { executeCommand } from "../utils/cpUtils";
8+
import { executeCommandWithProgress } from "../utils/cpUtils";
99
import { DialogOptions, DialogType, promptForOpenOutputChannel, promptForSignIn } from "../utils/uiUtils";
1010
import { selectWorkspaceFolder } from "../utils/workspaceUtils";
1111
import * as wsl from "../utils/wslUtils";
@@ -50,7 +50,7 @@ async function showProblemInternal(id: string): Promise<void> {
5050

5151
const outdir: string = await selectWorkspaceFolder();
5252
await fse.ensureDir(outdir);
53-
const result: string = await executeCommand("node", [leetCodeBinaryPath, "show", id, "-gx", "-l", language, "-o", `"${outdir}"`]);
53+
const result: string = await executeCommandWithProgress("Fetching problem data...", "node", [leetCodeBinaryPath, "show", id, "-gx", "-l", language, "-o", `"${outdir}"`]);
5454
const reg: RegExp = /\* Source Code:\s*(.*)/;
5555
const match: RegExpMatchArray | null = result.match(reg);
5656
if (match && match.length >= 2) {

src/utils/cpUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function executeCommand(command: string, args: string[], options: c
3434

3535
export async function executeCommandWithProgress(message: string, command: string, args: string[], options: cp.SpawnOptions = { shell: true }): Promise<string> {
3636
let result: string = "";
37-
await vscode.window.withProgress({ location: vscode.ProgressLocation.Window }, async (p: vscode.Progress<{}>) => {
37+
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification }, async (p: vscode.Progress<{}>) => {
3838
return new Promise(async (resolve: () => void, reject: (e: Error) => void): Promise<void> => {
3939
p.report({ message });
4040
try {

0 commit comments

Comments
 (0)