@@ -172,12 +172,81 @@ namespace ts.server {
172
172
} ) ;
173
173
174
174
describe ( "onMessage" , ( ) => {
175
+ const allCommandNames : CommandNames [ ] = [
176
+ CommandNames . Brace ,
177
+ CommandNames . BraceFull ,
178
+ CommandNames . BraceCompletion ,
179
+ CommandNames . Change ,
180
+ CommandNames . Close ,
181
+ CommandNames . Completions ,
182
+ CommandNames . CompletionsFull ,
183
+ CommandNames . CompletionDetails ,
184
+ CommandNames . CompileOnSaveAffectedFileList ,
185
+ CommandNames . Configure ,
186
+ CommandNames . Definition ,
187
+ CommandNames . DefinitionFull ,
188
+ CommandNames . Implementation ,
189
+ CommandNames . ImplementationFull ,
190
+ CommandNames . Exit ,
191
+ CommandNames . Format ,
192
+ CommandNames . Formatonkey ,
193
+ CommandNames . FormatFull ,
194
+ CommandNames . FormatonkeyFull ,
195
+ CommandNames . FormatRangeFull ,
196
+ CommandNames . Geterr ,
197
+ CommandNames . GeterrForProject ,
198
+ CommandNames . SemanticDiagnosticsSync ,
199
+ CommandNames . SyntacticDiagnosticsSync ,
200
+ CommandNames . NavBar ,
201
+ CommandNames . NavBarFull ,
202
+ CommandNames . Navto ,
203
+ CommandNames . NavtoFull ,
204
+ CommandNames . NavTree ,
205
+ CommandNames . NavTreeFull ,
206
+ CommandNames . Occurrences ,
207
+ CommandNames . DocumentHighlights ,
208
+ CommandNames . DocumentHighlightsFull ,
209
+ CommandNames . Open ,
210
+ CommandNames . Quickinfo ,
211
+ CommandNames . QuickinfoFull ,
212
+ CommandNames . References ,
213
+ CommandNames . ReferencesFull ,
214
+ CommandNames . Reload ,
215
+ CommandNames . Rename ,
216
+ CommandNames . RenameInfoFull ,
217
+ CommandNames . RenameLocationsFull ,
218
+ CommandNames . Saveto ,
219
+ CommandNames . SignatureHelp ,
220
+ CommandNames . SignatureHelpFull ,
221
+ CommandNames . TypeDefinition ,
222
+ CommandNames . ProjectInfo ,
223
+ CommandNames . ReloadProjects ,
224
+ CommandNames . Unknown ,
225
+ CommandNames . OpenExternalProject ,
226
+ CommandNames . CloseExternalProject ,
227
+ CommandNames . SynchronizeProjectList ,
228
+ CommandNames . ApplyChangedToOpenFiles ,
229
+ CommandNames . EncodedSemanticClassificationsFull ,
230
+ CommandNames . Cleanup ,
231
+ CommandNames . OutliningSpans ,
232
+ CommandNames . TodoComments ,
233
+ CommandNames . Indentation ,
234
+ CommandNames . DocCommentTemplate ,
235
+ CommandNames . CompilerOptionsDiagnosticsFull ,
236
+ CommandNames . NameOrDottedNameSpan ,
237
+ CommandNames . BreakpointStatement ,
238
+ CommandNames . CompilerOptionsForInferredProjects ,
239
+ CommandNames . GetCodeFixes ,
240
+ CommandNames . GetCodeFixesFull ,
241
+ CommandNames . GetSupportedCodeFixes ,
242
+ CommandNames . GetApplicableRefactors ,
243
+ CommandNames . GetRefactorCodeActions ,
244
+ CommandNames . GetRefactorCodeActionsFull ,
245
+ ] ;
246
+
175
247
it ( "should not throw when commands are executed with invalid arguments" , ( ) => {
176
248
let i = 0 ;
177
- for ( const name in CommandNames ) {
178
- if ( ! Object . prototype . hasOwnProperty . call ( CommandNames , name ) ) {
179
- continue ;
180
- }
249
+ for ( const name of allCommandNames ) {
181
250
const req : protocol . Request = {
182
251
command : name ,
183
252
seq : i ,
0 commit comments