diff options
Diffstat (limited to 'editors/code/src/commands/watch_status.ts')
-rw-r--r-- | editors/code/src/commands/watch_status.ts | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts index 8d64394c7..10787b510 100644 --- a/editors/code/src/commands/watch_status.ts +++ b/editors/code/src/commands/watch_status.ts | |||
@@ -57,7 +57,49 @@ export class StatusDisplay implements vscode.Disposable { | |||
57 | this.statusBarItem.dispose(); | 57 | this.statusBarItem.dispose(); |
58 | } | 58 | } |
59 | 59 | ||
60 | public handleProgressNotification(params: ProgressParams) { | ||
61 | const { token, value } = params; | ||
62 | if (token !== 'rustAnalyzer/cargoWatcher') { | ||
63 | return; | ||
64 | } | ||
65 | |||
66 | switch (value.kind) { | ||
67 | case 'begin': | ||
68 | this.show(); | ||
69 | break; | ||
70 | |||
71 | case 'report': | ||
72 | if (value.message) { | ||
73 | this.packageName = value.message; | ||
74 | } | ||
75 | break; | ||
76 | |||
77 | case 'end': | ||
78 | this.hide(); | ||
79 | break; | ||
80 | } | ||
81 | } | ||
82 | |||
60 | private frame() { | 83 | private frame() { |
61 | return spinnerFrames[(this.i = ++this.i % spinnerFrames.length)]; | 84 | return spinnerFrames[(this.i = ++this.i % spinnerFrames.length)]; |
62 | } | 85 | } |
63 | } | 86 | } |
87 | |||
88 | // FIXME: Replace this once vscode-languageclient is updated to LSP 3.15 | ||
89 | interface ProgressParams { | ||
90 | token: string; | ||
91 | value: WorkDoneProgress; | ||
92 | } | ||
93 | |||
94 | enum WorkDoneProgressKind { | ||
95 | Begin = 'begin', | ||
96 | Report = 'report', | ||
97 | End = 'end', | ||
98 | } | ||
99 | |||
100 | interface WorkDoneProgress { | ||
101 | kind: WorkDoneProgressKind; | ||
102 | message?: string; | ||
103 | cancelable?: boolean; | ||
104 | percentage?: string; | ||
105 | } | ||