aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/commands/watch_status.ts29
-rw-r--r--editors/code/src/extension.ts10
2 files changed, 20 insertions, 19 deletions
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts
index 2404c3f16..10787b510 100644
--- a/editors/code/src/commands/watch_status.ts
+++ b/editors/code/src/commands/watch_status.ts
@@ -59,23 +59,22 @@ export class StatusDisplay implements vscode.Disposable {
59 59
60 public handleProgressNotification(params: ProgressParams) { 60 public handleProgressNotification(params: ProgressParams) {
61 const { token, value } = params; 61 const { token, value } = params;
62 if (token !== "rustAnalyzer/cargoWatcher") { 62 if (token !== 'rustAnalyzer/cargoWatcher') {
63 return; 63 return;
64 } 64 }
65 65
66 console.log("Got progress notification", token, value)
67 switch (value.kind) { 66 switch (value.kind) {
68 case "begin": 67 case 'begin':
69 this.show(); 68 this.show();
70 break; 69 break;
71 70
72 case "report": 71 case 'report':
73 if (value.message) { 72 if (value.message) {
74 this.packageName = value.message; 73 this.packageName = value.message;
75 } 74 }
76 break; 75 break;
77 76
78 case "end": 77 case 'end':
79 this.hide(); 78 this.hide();
80 break; 79 break;
81 } 80 }
@@ -88,19 +87,19 @@ export class StatusDisplay implements vscode.Disposable {
88 87
89// FIXME: Replace this once vscode-languageclient is updated to LSP 3.15 88// FIXME: Replace this once vscode-languageclient is updated to LSP 3.15
90interface ProgressParams { 89interface ProgressParams {
91 token: string 90 token: string;
92 value: WorkDoneProgress 91 value: WorkDoneProgress;
93} 92}
94 93
95enum WorkDoneProgressKind { 94enum WorkDoneProgressKind {
96 Begin = "begin", 95 Begin = 'begin',
97 Report = "report", 96 Report = 'report',
98 End = "end" 97 End = 'end',
99} 98}
100 99
101interface WorkDoneProgress { 100interface WorkDoneProgress {
102 kind: WorkDoneProgressKind, 101 kind: WorkDoneProgressKind;
103 message?: string 102 message?: string;
104 cancelable?: boolean 103 cancelable?: boolean;
105 percentage?: string 104 percentage?: string;
106} \ No newline at end of file 105}
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index 1507cb26e..36163b6bb 100644
--- a/editors/code/src/extension.ts
+++ b/editors/code/src/extension.ts
@@ -5,10 +5,10 @@ import * as commands from './commands';
5import { ExpandMacroContentProvider } from './commands/expand_macro'; 5import { ExpandMacroContentProvider } from './commands/expand_macro';
6import { HintsUpdater } from './commands/inlay_hints'; 6import { HintsUpdater } from './commands/inlay_hints';
7import { SyntaxTreeContentProvider } from './commands/syntaxTree'; 7import { SyntaxTreeContentProvider } from './commands/syntaxTree';
8import { StatusDisplay } from './commands/watch_status';
8import * as events from './events'; 9import * as events from './events';
9import * as notifications from './notifications'; 10import * as notifications from './notifications';
10import { Server } from './server'; 11import { Server } from './server';
11import { StatusDisplay } from './commands/watch_status';
12 12
13export async function activate(context: vscode.ExtensionContext) { 13export async function activate(context: vscode.ExtensionContext) {
14 function disposeOnDeactivation(disposable: vscode.Disposable) { 14 function disposeOnDeactivation(disposable: vscode.Disposable) {
@@ -84,7 +84,9 @@ export async function activate(context: vscode.ExtensionContext) {
84 overrideCommand('type', commands.onEnter.handle); 84 overrideCommand('type', commands.onEnter.handle);
85 } 85 }
86 86
87 const watchStatus = new StatusDisplay(Server.config.cargoCheckOptions.command || 'check'); 87 const watchStatus = new StatusDisplay(
88 Server.config.cargoCheckOptions.command || 'check',
89 );
88 disposeOnDeactivation(watchStatus); 90 disposeOnDeactivation(watchStatus);
89 91
90 // Notifications are events triggered by the language server 92 // Notifications are events triggered by the language server
@@ -98,8 +100,8 @@ export async function activate(context: vscode.ExtensionContext) {
98 ], 100 ],
99 [ 101 [
100 '$/progress', 102 '$/progress',
101 (params) => watchStatus.handleProgressNotification(params), 103 params => watchStatus.handleProgressNotification(params),
102 ] 104 ],
103 ]; 105 ];
104 const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); 106 const syntaxTreeContentProvider = new SyntaxTreeContentProvider();
105 const expandMacroContentProvider = new ExpandMacroContentProvider(); 107 const expandMacroContentProvider = new ExpandMacroContentProvider();