diff options
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r-- | editors/code/src/commands/watch_status.ts | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts index 8d64394c7..2404c3f16 100644 --- a/editors/code/src/commands/watch_status.ts +++ b/editors/code/src/commands/watch_status.ts | |||
@@ -57,7 +57,50 @@ 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 | console.log("Got progress notification", token, value) | ||
67 | switch (value.kind) { | ||
68 | case "begin": | ||
69 | this.show(); | ||
70 | break; | ||
71 | |||
72 | case "report": | ||
73 | if (value.message) { | ||
74 | this.packageName = value.message; | ||
75 | } | ||
76 | break; | ||
77 | |||
78 | case "end": | ||
79 | this.hide(); | ||
80 | break; | ||
81 | } | ||
82 | } | ||
83 | |||
60 | private frame() { | 84 | private frame() { |
61 | return spinnerFrames[(this.i = ++this.i % spinnerFrames.length)]; | 85 | return spinnerFrames[(this.i = ++this.i % spinnerFrames.length)]; |
62 | } | 86 | } |
63 | } | 87 | } |
88 | |||
89 | // FIXME: Replace this once vscode-languageclient is updated to LSP 3.15 | ||
90 | interface ProgressParams { | ||
91 | token: string | ||
92 | value: WorkDoneProgress | ||
93 | } | ||
94 | |||
95 | enum WorkDoneProgressKind { | ||
96 | Begin = "begin", | ||
97 | Report = "report", | ||
98 | End = "end" | ||
99 | } | ||
100 | |||
101 | interface WorkDoneProgress { | ||
102 | kind: WorkDoneProgressKind, | ||
103 | message?: string | ||
104 | cancelable?: boolean | ||
105 | percentage?: string | ||
106 | } \ No newline at end of file | ||