Skip to content

Commit b5a9d58

Browse files
committed
show files loading progress bar
1 parent a405a90 commit b5a9d58

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/extension.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function startClient() {
7272
// command: "java",
7373
// args: ["-cp", cp, "org.emmylua.vscode.MainKt"]
7474
// };
75+
let progressBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
7576

7677
client = new LanguageClient("EmmyLua", "EmmyLua plugin for vscode.", serverOptions, clientOptions);
7778
client.onReady().then(() => {
@@ -82,7 +83,13 @@ function startClient() {
8283
}
8384
});
8485
client.onNotification("emmy/progressReport", (d: notifications.IProgressReport) => {
85-
console.log("---->>>" + d.text);
86+
progressBar.show();
87+
progressBar.text = d.text;
88+
if (d.percent >= 1) {
89+
setTimeout(() => {
90+
progressBar.hide();
91+
}, 3000);
92+
}
8693
});
8794
});
8895
let disposable = client.start();

src/notifications.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ export interface IAnnotator {
1010
}
1111

1212
export interface IProgressReport {
13-
text: String;
13+
text: string;
14+
percent: number;
1415
}

0 commit comments

Comments
 (0)