Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit dd1ec79

Browse files
authored
Merge pull request #771 from rust-lang/uniform-spinner
Use octicon spinner in status bar item
2 parents 3ec987d + 0bd2d92 commit dd1ec79

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### Unreleased
22

3+
* Use smooth, universally supported spinner in the status bar ⚙️
4+
35
### 0.7.3 - 2020-04-21
46

57
* Remove redundant `rust-client.nestedMultiRootConfigInOutermost` setting (originally used to work around non-multi-project limitations)

src/spinner.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
import { window } from 'vscode';
22

33
export function startSpinner(prefix: string, postfix: string) {
4-
if (spinnerTimer != null) {
5-
clearInterval(spinnerTimer);
6-
}
7-
let state = 0;
8-
spinnerTimer = setInterval(() => {
9-
window.setStatusBarMessage(`${prefix} ${spinner[state]} ${postfix}`);
10-
state = (state + 1) % spinner.length;
11-
}, 100);
4+
window.setStatusBarMessage(`${prefix} $(settings-gear~spin) ${postfix}`);
125
}
136

147
export function stopSpinner(message: string) {
15-
if (spinnerTimer) {
16-
clearInterval(spinnerTimer);
17-
}
18-
spinnerTimer = null;
19-
208
window.setStatusBarMessage(message);
219
}
22-
23-
let spinnerTimer: NodeJS.Timer | null = null;
24-
const spinner = ['🌕', '🌖', '🌗', '🌘', '🌑', '🌒', '🌓', '🌔'];

0 commit comments

Comments
 (0)