@@ -122,6 +122,26 @@ export namespace OpenFileRequest {
122
122
{ get method ( ) { return 'editor/openFile' ; } } ;
123
123
}
124
124
125
+ export namespace ShowErrorMessageRequest {
126
+ export const type : RequestType < string , EditorOperationResponse , void > =
127
+ { get method ( ) { return 'editor/showErrorMessage' ; } } ;
128
+ }
129
+
130
+ export namespace ShowWarningMessageRequest {
131
+ export const type : RequestType < string , EditorOperationResponse , void > =
132
+ { get method ( ) { return 'editor/showWarningMessage' ; } } ;
133
+ }
134
+
135
+ export namespace ShowInformationMessageRequest {
136
+ export const type : RequestType < string , EditorOperationResponse , void > =
137
+ { get method ( ) { return 'editor/showInformationMessage' ; } } ;
138
+ }
139
+
140
+ export namespace SetStatusBarMessageRequest {
141
+ export const type : RequestType < string , EditorOperationResponse , void > =
142
+ { get method ( ) { return 'editor/setStatusBarMessage' ; } } ;
143
+ }
144
+
125
145
export class ExtensionCommandsFeature implements IFeature {
126
146
127
147
private command : vscode . Disposable ;
@@ -172,6 +192,22 @@ export class ExtensionCommandsFeature implements IFeature {
172
192
this . languageClient . onRequest (
173
193
OpenFileRequest . type ,
174
194
filePath => this . openFile ( filePath ) ) ;
195
+
196
+ this . languageClient . onRequest (
197
+ ShowInformationMessageRequest . type ,
198
+ message => this . showInformationMessage ( message ) ) ;
199
+
200
+ this . languageClient . onRequest (
201
+ ShowErrorMessageRequest . type ,
202
+ message => this . showErrorMessage ( message ) ) ;
203
+
204
+ this . languageClient . onRequest (
205
+ ShowWarningMessageRequest . type ,
206
+ message => this . showWarningMessage ( message ) ) ;
207
+
208
+ this . languageClient . onRequest (
209
+ SetStatusBarMessageRequest . type ,
210
+ message => this . setStatusBarMessage ( message ) ) ;
175
211
}
176
212
}
177
213
@@ -285,4 +321,27 @@ export class ExtensionCommandsFeature implements IFeature {
285
321
286
322
return EditorOperationResponse . Completed ;
287
323
}
324
+
325
+ private showInformationMessage ( message : string ) : Thenable < EditorOperationResponse > {
326
+ return vscode . window
327
+ . showInformationMessage ( message )
328
+ . then ( _ => EditorOperationResponse . Completed ) ;
329
+ }
330
+
331
+ private showErrorMessage ( message : string ) : Thenable < EditorOperationResponse > {
332
+ return vscode . window
333
+ . showErrorMessage ( message )
334
+ . then ( _ => EditorOperationResponse . Completed ) ;
335
+ }
336
+
337
+ private showWarningMessage ( message : string ) : Thenable < EditorOperationResponse > {
338
+ return vscode . window
339
+ . showWarningMessage ( message )
340
+ . then ( _ => EditorOperationResponse . Completed ) ;
341
+ }
342
+
343
+ private setStatusBarMessage ( message : string ) : EditorOperationResponse {
344
+ vscode . window . setStatusBarMessage ( message ) ;
345
+ return EditorOperationResponse . Completed ;
346
+ }
288
347
}
0 commit comments