tsrc 2.1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/Gemfile +7 -0
- data/LICENSE +55 -0
- data/README.md +33 -0
- data/Rakefile +16 -0
- data/lib/tsrc.rb +57 -0
- data/lib/tsrc/support/typescript/.mailmap +216 -0
- data/lib/tsrc/support/typescript/.npmignore +19 -0
- data/lib/tsrc/support/typescript/AUTHORS.md +204 -0
- data/lib/tsrc/support/typescript/CONTRIBUTING.md +185 -0
- data/lib/tsrc/support/typescript/CopyrightNotice.txt +15 -0
- data/lib/tsrc/support/typescript/LICENSE.txt +55 -0
- data/lib/tsrc/support/typescript/README.md +98 -0
- data/lib/tsrc/support/typescript/ThirdPartyNoticeText.txt +35 -0
- data/lib/tsrc/support/typescript/bin/tsc +2 -0
- data/lib/tsrc/support/typescript/bin/tsserver +2 -0
- data/lib/tsrc/support/typescript/lib/README.md +5 -0
- data/lib/tsrc/support/typescript/lib/cancellationToken.js +41 -0
- data/lib/tsrc/support/typescript/lib/lib.d.ts +18215 -0
- data/lib/tsrc/support/typescript/lib/lib.dom.d.ts +13738 -0
- data/lib/tsrc/support/typescript/lib/lib.dom.iterable.d.ts +33 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.collection.d.ts +92 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.core.d.ts +544 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.d.ts +30 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.generator.d.ts +32 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.iterable.d.ts +465 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.promise.d.ts +274 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.proxy.d.ts +42 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.reflect.d.ts +35 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.symbol.d.ts +56 -0
- data/lib/tsrc/support/typescript/lib/lib.es2015.symbol.wellknown.d.ts +347 -0
- data/lib/tsrc/support/typescript/lib/lib.es2016.array.include.d.ts +118 -0
- data/lib/tsrc/support/typescript/lib/lib.es2016.d.ts +22 -0
- data/lib/tsrc/support/typescript/lib/lib.es2017.d.ts +24 -0
- data/lib/tsrc/support/typescript/lib/lib.es2017.object.d.ts +45 -0
- data/lib/tsrc/support/typescript/lib/lib.es2017.sharedmemory.d.ts +47 -0
- data/lib/tsrc/support/typescript/lib/lib.es2017.string.d.ts +47 -0
- data/lib/tsrc/support/typescript/lib/lib.es5.d.ts +4195 -0
- data/lib/tsrc/support/typescript/lib/lib.es6.d.ts +19950 -0
- data/lib/tsrc/support/typescript/lib/lib.scripthost.d.ts +311 -0
- data/lib/tsrc/support/typescript/lib/lib.webworker.d.ts +1274 -0
- data/lib/tsrc/support/typescript/lib/protocol.d.ts +1900 -0
- data/lib/tsrc/support/typescript/lib/tsc.js +52470 -0
- data/lib/tsrc/support/typescript/lib/tsserver.js +70720 -0
- data/lib/tsrc/support/typescript/lib/tsserverlibrary.d.ts +11939 -0
- data/lib/tsrc/support/typescript/lib/tsserverlibrary.js +70256 -0
- data/lib/tsrc/support/typescript/lib/typescript.d.ts +3166 -0
- data/lib/tsrc/support/typescript/lib/typescript.js +81536 -0
- data/lib/tsrc/support/typescript/lib/typescriptServices.d.ts +3164 -0
- data/lib/tsrc/support/typescript/lib/typescriptServices.js +81536 -0
- data/lib/tsrc/support/typescript/lib/typingsInstaller.js +7314 -0
- data/lib/tsrc/support/typescript/package.json +129 -0
- data/lib/tsrc/support/typescript/test.config +1 -0
- data/lib/tsrc/version.rb +5 -0
- data/tsrc.gemspec +20 -0
- metadata +113 -0
@@ -0,0 +1,1900 @@
|
|
1
|
+
/**
|
2
|
+
* Declaration module describing the TypeScript Server protocol
|
3
|
+
*/
|
4
|
+
declare namespace ts.server.protocol {
|
5
|
+
namespace CommandTypes {
|
6
|
+
type Brace = "brace";
|
7
|
+
type BraceCompletion = "braceCompletion";
|
8
|
+
type Change = "change";
|
9
|
+
type Close = "close";
|
10
|
+
type Completions = "completions";
|
11
|
+
type CompletionDetails = "completionEntryDetails";
|
12
|
+
type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList";
|
13
|
+
type CompileOnSaveEmitFile = "compileOnSaveEmitFile";
|
14
|
+
type Configure = "configure";
|
15
|
+
type Definition = "definition";
|
16
|
+
type Implementation = "implementation";
|
17
|
+
type Exit = "exit";
|
18
|
+
type Format = "format";
|
19
|
+
type Formatonkey = "formatonkey";
|
20
|
+
type Geterr = "geterr";
|
21
|
+
type GeterrForProject = "geterrForProject";
|
22
|
+
type SemanticDiagnosticsSync = "semanticDiagnosticsSync";
|
23
|
+
type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync";
|
24
|
+
type NavBar = "navbar";
|
25
|
+
type Navto = "navto";
|
26
|
+
type NavTree = "navtree";
|
27
|
+
type NavTreeFull = "navtree-full";
|
28
|
+
type Occurrences = "occurrences";
|
29
|
+
type DocumentHighlights = "documentHighlights";
|
30
|
+
type Open = "open";
|
31
|
+
type Quickinfo = "quickinfo";
|
32
|
+
type References = "references";
|
33
|
+
type Reload = "reload";
|
34
|
+
type Rename = "rename";
|
35
|
+
type Saveto = "saveto";
|
36
|
+
type SignatureHelp = "signatureHelp";
|
37
|
+
type TypeDefinition = "typeDefinition";
|
38
|
+
type ProjectInfo = "projectInfo";
|
39
|
+
type ReloadProjects = "reloadProjects";
|
40
|
+
type Unknown = "unknown";
|
41
|
+
type OpenExternalProject = "openExternalProject";
|
42
|
+
type OpenExternalProjects = "openExternalProjects";
|
43
|
+
type CloseExternalProject = "closeExternalProject";
|
44
|
+
type TodoComments = "todoComments";
|
45
|
+
type Indentation = "indentation";
|
46
|
+
type DocCommentTemplate = "docCommentTemplate";
|
47
|
+
type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects";
|
48
|
+
type GetCodeFixes = "getCodeFixes";
|
49
|
+
type GetSupportedCodeFixes = "getSupportedCodeFixes";
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
* A TypeScript Server message
|
53
|
+
*/
|
54
|
+
interface Message {
|
55
|
+
/**
|
56
|
+
* Sequence number of the message
|
57
|
+
*/
|
58
|
+
seq: number;
|
59
|
+
/**
|
60
|
+
* One of "request", "response", or "event"
|
61
|
+
*/
|
62
|
+
type: "request" | "response" | "event";
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* Client-initiated request message
|
66
|
+
*/
|
67
|
+
interface Request extends Message {
|
68
|
+
/**
|
69
|
+
* The command to execute
|
70
|
+
*/
|
71
|
+
command: string;
|
72
|
+
/**
|
73
|
+
* Object containing arguments for the command
|
74
|
+
*/
|
75
|
+
arguments?: any;
|
76
|
+
}
|
77
|
+
/**
|
78
|
+
* Request to reload the project structure for all the opened files
|
79
|
+
*/
|
80
|
+
interface ReloadProjectsRequest extends Message {
|
81
|
+
command: CommandTypes.ReloadProjects;
|
82
|
+
}
|
83
|
+
/**
|
84
|
+
* Server-initiated event message
|
85
|
+
*/
|
86
|
+
interface Event extends Message {
|
87
|
+
/**
|
88
|
+
* Name of event
|
89
|
+
*/
|
90
|
+
event: string;
|
91
|
+
/**
|
92
|
+
* Event-specific information
|
93
|
+
*/
|
94
|
+
body?: any;
|
95
|
+
}
|
96
|
+
/**
|
97
|
+
* Response by server to client request message.
|
98
|
+
*/
|
99
|
+
interface Response extends Message {
|
100
|
+
/**
|
101
|
+
* Sequence number of the request message.
|
102
|
+
*/
|
103
|
+
request_seq: number;
|
104
|
+
/**
|
105
|
+
* Outcome of the request.
|
106
|
+
*/
|
107
|
+
success: boolean;
|
108
|
+
/**
|
109
|
+
* The command requested.
|
110
|
+
*/
|
111
|
+
command: string;
|
112
|
+
/**
|
113
|
+
* Contains error message if success === false.
|
114
|
+
*/
|
115
|
+
message?: string;
|
116
|
+
/**
|
117
|
+
* Contains message body if success === true.
|
118
|
+
*/
|
119
|
+
body?: any;
|
120
|
+
}
|
121
|
+
/**
|
122
|
+
* Arguments for FileRequest messages.
|
123
|
+
*/
|
124
|
+
interface FileRequestArgs {
|
125
|
+
/**
|
126
|
+
* The file for the request (absolute pathname required).
|
127
|
+
*/
|
128
|
+
file: string;
|
129
|
+
projectFileName?: string;
|
130
|
+
}
|
131
|
+
/**
|
132
|
+
* Requests a JS Doc comment template for a given position
|
133
|
+
*/
|
134
|
+
interface DocCommentTemplateRequest extends FileLocationRequest {
|
135
|
+
command: CommandTypes.DocCommentTemplate;
|
136
|
+
}
|
137
|
+
/**
|
138
|
+
* Response to DocCommentTemplateRequest
|
139
|
+
*/
|
140
|
+
interface DocCommandTemplateResponse extends Response {
|
141
|
+
body?: TextInsertion;
|
142
|
+
}
|
143
|
+
/**
|
144
|
+
* A request to get TODO comments from the file
|
145
|
+
*/
|
146
|
+
interface TodoCommentRequest extends FileRequest {
|
147
|
+
command: CommandTypes.TodoComments;
|
148
|
+
arguments: TodoCommentRequestArgs;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* Arguments for TodoCommentRequest request.
|
152
|
+
*/
|
153
|
+
interface TodoCommentRequestArgs extends FileRequestArgs {
|
154
|
+
/**
|
155
|
+
* Array of target TodoCommentDescriptors that describes TODO comments to be found
|
156
|
+
*/
|
157
|
+
descriptors: TodoCommentDescriptor[];
|
158
|
+
}
|
159
|
+
/**
|
160
|
+
* Response for TodoCommentRequest request.
|
161
|
+
*/
|
162
|
+
interface TodoCommentsResponse extends Response {
|
163
|
+
body?: TodoComment[];
|
164
|
+
}
|
165
|
+
/**
|
166
|
+
* A request to get indentation for a location in file
|
167
|
+
*/
|
168
|
+
interface IndentationRequest extends FileLocationRequest {
|
169
|
+
command: CommandTypes.Indentation;
|
170
|
+
arguments: IndentationRequestArgs;
|
171
|
+
}
|
172
|
+
/**
|
173
|
+
* Response for IndentationRequest request.
|
174
|
+
*/
|
175
|
+
interface IndentationResponse extends Response {
|
176
|
+
body?: IndentationResult;
|
177
|
+
}
|
178
|
+
/**
|
179
|
+
* Indentation result representing where indentation should be placed
|
180
|
+
*/
|
181
|
+
interface IndentationResult {
|
182
|
+
/**
|
183
|
+
* The base position in the document that the indent should be relative to
|
184
|
+
*/
|
185
|
+
position: number;
|
186
|
+
/**
|
187
|
+
* The number of columns the indent should be at relative to the position's column.
|
188
|
+
*/
|
189
|
+
indentation: number;
|
190
|
+
}
|
191
|
+
/**
|
192
|
+
* Arguments for IndentationRequest request.
|
193
|
+
*/
|
194
|
+
interface IndentationRequestArgs extends FileLocationRequestArgs {
|
195
|
+
/**
|
196
|
+
* An optional set of settings to be used when computing indentation.
|
197
|
+
* If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
|
198
|
+
*/
|
199
|
+
options?: EditorSettings;
|
200
|
+
}
|
201
|
+
/**
|
202
|
+
* Arguments for ProjectInfoRequest request.
|
203
|
+
*/
|
204
|
+
interface ProjectInfoRequestArgs extends FileRequestArgs {
|
205
|
+
/**
|
206
|
+
* Indicate if the file name list of the project is needed
|
207
|
+
*/
|
208
|
+
needFileNameList: boolean;
|
209
|
+
}
|
210
|
+
/**
|
211
|
+
* A request to get the project information of the current file.
|
212
|
+
*/
|
213
|
+
interface ProjectInfoRequest extends Request {
|
214
|
+
command: CommandTypes.ProjectInfo;
|
215
|
+
arguments: ProjectInfoRequestArgs;
|
216
|
+
}
|
217
|
+
/**
|
218
|
+
* A request to retrieve compiler options diagnostics for a project
|
219
|
+
*/
|
220
|
+
interface CompilerOptionsDiagnosticsRequest extends Request {
|
221
|
+
arguments: CompilerOptionsDiagnosticsRequestArgs;
|
222
|
+
}
|
223
|
+
/**
|
224
|
+
* Arguments for CompilerOptionsDiagnosticsRequest request.
|
225
|
+
*/
|
226
|
+
interface CompilerOptionsDiagnosticsRequestArgs {
|
227
|
+
/**
|
228
|
+
* Name of the project to retrieve compiler options diagnostics.
|
229
|
+
*/
|
230
|
+
projectFileName: string;
|
231
|
+
}
|
232
|
+
/**
|
233
|
+
* Response message body for "projectInfo" request
|
234
|
+
*/
|
235
|
+
interface ProjectInfo {
|
236
|
+
/**
|
237
|
+
* For configured project, this is the normalized path of the 'tsconfig.json' file
|
238
|
+
* For inferred project, this is undefined
|
239
|
+
*/
|
240
|
+
configFileName: string;
|
241
|
+
/**
|
242
|
+
* The list of normalized file name in the project, including 'lib.d.ts'
|
243
|
+
*/
|
244
|
+
fileNames?: string[];
|
245
|
+
/**
|
246
|
+
* Indicates if the project has a active language service instance
|
247
|
+
*/
|
248
|
+
languageServiceDisabled?: boolean;
|
249
|
+
}
|
250
|
+
/**
|
251
|
+
* Represents diagnostic info that includes location of diagnostic in two forms
|
252
|
+
* - start position and length of the error span
|
253
|
+
* - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
|
254
|
+
*/
|
255
|
+
interface DiagnosticWithLinePosition {
|
256
|
+
message: string;
|
257
|
+
start: number;
|
258
|
+
length: number;
|
259
|
+
startLocation: Location;
|
260
|
+
endLocation: Location;
|
261
|
+
category: string;
|
262
|
+
code: number;
|
263
|
+
}
|
264
|
+
/**
|
265
|
+
* Response message for "projectInfo" request
|
266
|
+
*/
|
267
|
+
interface ProjectInfoResponse extends Response {
|
268
|
+
body?: ProjectInfo;
|
269
|
+
}
|
270
|
+
/**
|
271
|
+
* Request whose sole parameter is a file name.
|
272
|
+
*/
|
273
|
+
interface FileRequest extends Request {
|
274
|
+
arguments: FileRequestArgs;
|
275
|
+
}
|
276
|
+
/**
|
277
|
+
* Instances of this interface specify a location in a source file:
|
278
|
+
* (file, line, character offset), where line and character offset are 1-based.
|
279
|
+
*/
|
280
|
+
interface FileLocationRequestArgs extends FileRequestArgs {
|
281
|
+
/**
|
282
|
+
* The line number for the request (1-based).
|
283
|
+
*/
|
284
|
+
line: number;
|
285
|
+
/**
|
286
|
+
* The character offset (on the line) for the request (1-based).
|
287
|
+
*/
|
288
|
+
offset: number;
|
289
|
+
}
|
290
|
+
/**
|
291
|
+
* Request for the available codefixes at a specific position.
|
292
|
+
*/
|
293
|
+
interface CodeFixRequest extends Request {
|
294
|
+
command: CommandTypes.GetCodeFixes;
|
295
|
+
arguments: CodeFixRequestArgs;
|
296
|
+
}
|
297
|
+
/**
|
298
|
+
* Instances of this interface specify errorcodes on a specific location in a sourcefile.
|
299
|
+
*/
|
300
|
+
interface CodeFixRequestArgs extends FileRequestArgs {
|
301
|
+
/**
|
302
|
+
* The line number for the request (1-based).
|
303
|
+
*/
|
304
|
+
startLine: number;
|
305
|
+
/**
|
306
|
+
* The character offset (on the line) for the request (1-based).
|
307
|
+
*/
|
308
|
+
startOffset: number;
|
309
|
+
/**
|
310
|
+
* The line number for the request (1-based).
|
311
|
+
*/
|
312
|
+
endLine: number;
|
313
|
+
/**
|
314
|
+
* The character offset (on the line) for the request (1-based).
|
315
|
+
*/
|
316
|
+
endOffset: number;
|
317
|
+
/**
|
318
|
+
* Errorcodes we want to get the fixes for.
|
319
|
+
*/
|
320
|
+
errorCodes?: number[];
|
321
|
+
}
|
322
|
+
/**
|
323
|
+
* Response for GetCodeFixes request.
|
324
|
+
*/
|
325
|
+
interface GetCodeFixesResponse extends Response {
|
326
|
+
body?: CodeAction[];
|
327
|
+
}
|
328
|
+
/**
|
329
|
+
* A request whose arguments specify a file location (file, line, col).
|
330
|
+
*/
|
331
|
+
interface FileLocationRequest extends FileRequest {
|
332
|
+
arguments: FileLocationRequestArgs;
|
333
|
+
}
|
334
|
+
/**
|
335
|
+
* A request to get codes of supported code fixes.
|
336
|
+
*/
|
337
|
+
interface GetSupportedCodeFixesRequest extends Request {
|
338
|
+
command: CommandTypes.GetSupportedCodeFixes;
|
339
|
+
}
|
340
|
+
/**
|
341
|
+
* A response for GetSupportedCodeFixesRequest request.
|
342
|
+
*/
|
343
|
+
interface GetSupportedCodeFixesResponse extends Response {
|
344
|
+
/**
|
345
|
+
* List of error codes supported by the server.
|
346
|
+
*/
|
347
|
+
body?: string[];
|
348
|
+
}
|
349
|
+
/**
|
350
|
+
* Arguments for EncodedSemanticClassificationsRequest request.
|
351
|
+
*/
|
352
|
+
interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
|
353
|
+
/**
|
354
|
+
* Start position of the span.
|
355
|
+
*/
|
356
|
+
start: number;
|
357
|
+
/**
|
358
|
+
* Length of the span.
|
359
|
+
*/
|
360
|
+
length: number;
|
361
|
+
}
|
362
|
+
/**
|
363
|
+
* Arguments in document highlight request; include: filesToSearch, file,
|
364
|
+
* line, offset.
|
365
|
+
*/
|
366
|
+
interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
|
367
|
+
/**
|
368
|
+
* List of files to search for document highlights.
|
369
|
+
*/
|
370
|
+
filesToSearch: string[];
|
371
|
+
}
|
372
|
+
/**
|
373
|
+
* Go to definition request; value of command field is
|
374
|
+
* "definition". Return response giving the file locations that
|
375
|
+
* define the symbol found in file at location line, col.
|
376
|
+
*/
|
377
|
+
interface DefinitionRequest extends FileLocationRequest {
|
378
|
+
command: CommandTypes.Definition;
|
379
|
+
}
|
380
|
+
/**
|
381
|
+
* Go to type request; value of command field is
|
382
|
+
* "typeDefinition". Return response giving the file locations that
|
383
|
+
* define the type for the symbol found in file at location line, col.
|
384
|
+
*/
|
385
|
+
interface TypeDefinitionRequest extends FileLocationRequest {
|
386
|
+
command: CommandTypes.TypeDefinition;
|
387
|
+
}
|
388
|
+
/**
|
389
|
+
* Go to implementation request; value of command field is
|
390
|
+
* "implementation". Return response giving the file locations that
|
391
|
+
* implement the symbol found in file at location line, col.
|
392
|
+
*/
|
393
|
+
interface ImplementationRequest extends FileLocationRequest {
|
394
|
+
command: CommandTypes.Implementation;
|
395
|
+
}
|
396
|
+
/**
|
397
|
+
* Location in source code expressed as (one-based) line and character offset.
|
398
|
+
*/
|
399
|
+
interface Location {
|
400
|
+
line: number;
|
401
|
+
offset: number;
|
402
|
+
}
|
403
|
+
/**
|
404
|
+
* Object found in response messages defining a span of text in source code.
|
405
|
+
*/
|
406
|
+
interface TextSpan {
|
407
|
+
/**
|
408
|
+
* First character of the definition.
|
409
|
+
*/
|
410
|
+
start: Location;
|
411
|
+
/**
|
412
|
+
* One character past last character of the definition.
|
413
|
+
*/
|
414
|
+
end: Location;
|
415
|
+
}
|
416
|
+
/**
|
417
|
+
* Object found in response messages defining a span of text in a specific source file.
|
418
|
+
*/
|
419
|
+
interface FileSpan extends TextSpan {
|
420
|
+
/**
|
421
|
+
* File containing text span.
|
422
|
+
*/
|
423
|
+
file: string;
|
424
|
+
}
|
425
|
+
/**
|
426
|
+
* Definition response message. Gives text range for definition.
|
427
|
+
*/
|
428
|
+
interface DefinitionResponse extends Response {
|
429
|
+
body?: FileSpan[];
|
430
|
+
}
|
431
|
+
/**
|
432
|
+
* Definition response message. Gives text range for definition.
|
433
|
+
*/
|
434
|
+
interface TypeDefinitionResponse extends Response {
|
435
|
+
body?: FileSpan[];
|
436
|
+
}
|
437
|
+
/**
|
438
|
+
* Implementation response message. Gives text range for implementations.
|
439
|
+
*/
|
440
|
+
interface ImplementationResponse extends Response {
|
441
|
+
body?: FileSpan[];
|
442
|
+
}
|
443
|
+
/**
|
444
|
+
* Request to get brace completion for a location in the file.
|
445
|
+
*/
|
446
|
+
interface BraceCompletionRequest extends FileLocationRequest {
|
447
|
+
command: CommandTypes.BraceCompletion;
|
448
|
+
arguments: BraceCompletionRequestArgs;
|
449
|
+
}
|
450
|
+
/**
|
451
|
+
* Argument for BraceCompletionRequest request.
|
452
|
+
*/
|
453
|
+
interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
|
454
|
+
/**
|
455
|
+
* Kind of opening brace
|
456
|
+
*/
|
457
|
+
openingBrace: string;
|
458
|
+
}
|
459
|
+
/**
|
460
|
+
* Get occurrences request; value of command field is
|
461
|
+
* "occurrences". Return response giving spans that are relevant
|
462
|
+
* in the file at a given line and column.
|
463
|
+
*/
|
464
|
+
interface OccurrencesRequest extends FileLocationRequest {
|
465
|
+
command: CommandTypes.Occurrences;
|
466
|
+
}
|
467
|
+
interface OccurrencesResponseItem extends FileSpan {
|
468
|
+
/**
|
469
|
+
* True if the occurrence is a write location, false otherwise.
|
470
|
+
*/
|
471
|
+
isWriteAccess: boolean;
|
472
|
+
}
|
473
|
+
interface OccurrencesResponse extends Response {
|
474
|
+
body?: OccurrencesResponseItem[];
|
475
|
+
}
|
476
|
+
/**
|
477
|
+
* Get document highlights request; value of command field is
|
478
|
+
* "documentHighlights". Return response giving spans that are relevant
|
479
|
+
* in the file at a given line and column.
|
480
|
+
*/
|
481
|
+
interface DocumentHighlightsRequest extends FileLocationRequest {
|
482
|
+
command: CommandTypes.DocumentHighlights;
|
483
|
+
arguments: DocumentHighlightsRequestArgs;
|
484
|
+
}
|
485
|
+
/**
|
486
|
+
* Span augmented with extra information that denotes the kind of the highlighting to be used for span.
|
487
|
+
* Kind is taken from HighlightSpanKind type.
|
488
|
+
*/
|
489
|
+
interface HighlightSpan extends TextSpan {
|
490
|
+
kind: string;
|
491
|
+
}
|
492
|
+
/**
|
493
|
+
* Represents a set of highligh spans for a give name
|
494
|
+
*/
|
495
|
+
interface DocumentHighlightsItem {
|
496
|
+
/**
|
497
|
+
* File containing highlight spans.
|
498
|
+
*/
|
499
|
+
file: string;
|
500
|
+
/**
|
501
|
+
* Spans to highlight in file.
|
502
|
+
*/
|
503
|
+
highlightSpans: HighlightSpan[];
|
504
|
+
}
|
505
|
+
/**
|
506
|
+
* Response for a DocumentHighlightsRequest request.
|
507
|
+
*/
|
508
|
+
interface DocumentHighlightsResponse extends Response {
|
509
|
+
body?: DocumentHighlightsItem[];
|
510
|
+
}
|
511
|
+
/**
|
512
|
+
* Find references request; value of command field is
|
513
|
+
* "references". Return response giving the file locations that
|
514
|
+
* reference the symbol found in file at location line, col.
|
515
|
+
*/
|
516
|
+
interface ReferencesRequest extends FileLocationRequest {
|
517
|
+
command: CommandTypes.References;
|
518
|
+
}
|
519
|
+
interface ReferencesResponseItem extends FileSpan {
|
520
|
+
/** Text of line containing the reference. Including this
|
521
|
+
* with the response avoids latency of editor loading files
|
522
|
+
* to show text of reference line (the server already has
|
523
|
+
* loaded the referencing files).
|
524
|
+
*/
|
525
|
+
lineText: string;
|
526
|
+
/**
|
527
|
+
* True if reference is a write location, false otherwise.
|
528
|
+
*/
|
529
|
+
isWriteAccess: boolean;
|
530
|
+
/**
|
531
|
+
* True if reference is a definition, false otherwise.
|
532
|
+
*/
|
533
|
+
isDefinition: boolean;
|
534
|
+
}
|
535
|
+
/**
|
536
|
+
* The body of a "references" response message.
|
537
|
+
*/
|
538
|
+
interface ReferencesResponseBody {
|
539
|
+
/**
|
540
|
+
* The file locations referencing the symbol.
|
541
|
+
*/
|
542
|
+
refs: ReferencesResponseItem[];
|
543
|
+
/**
|
544
|
+
* The name of the symbol.
|
545
|
+
*/
|
546
|
+
symbolName: string;
|
547
|
+
/**
|
548
|
+
* The start character offset of the symbol (on the line provided by the references request).
|
549
|
+
*/
|
550
|
+
symbolStartOffset: number;
|
551
|
+
/**
|
552
|
+
* The full display name of the symbol.
|
553
|
+
*/
|
554
|
+
symbolDisplayString: string;
|
555
|
+
}
|
556
|
+
/**
|
557
|
+
* Response to "references" request.
|
558
|
+
*/
|
559
|
+
interface ReferencesResponse extends Response {
|
560
|
+
body?: ReferencesResponseBody;
|
561
|
+
}
|
562
|
+
/**
|
563
|
+
* Argument for RenameRequest request.
|
564
|
+
*/
|
565
|
+
interface RenameRequestArgs extends FileLocationRequestArgs {
|
566
|
+
/**
|
567
|
+
* Should text at specified location be found/changed in comments?
|
568
|
+
*/
|
569
|
+
findInComments?: boolean;
|
570
|
+
/**
|
571
|
+
* Should text at specified location be found/changed in strings?
|
572
|
+
*/
|
573
|
+
findInStrings?: boolean;
|
574
|
+
}
|
575
|
+
/**
|
576
|
+
* Rename request; value of command field is "rename". Return
|
577
|
+
* response giving the file locations that reference the symbol
|
578
|
+
* found in file at location line, col. Also return full display
|
579
|
+
* name of the symbol so that client can print it unambiguously.
|
580
|
+
*/
|
581
|
+
interface RenameRequest extends FileLocationRequest {
|
582
|
+
command: CommandTypes.Rename;
|
583
|
+
arguments: RenameRequestArgs;
|
584
|
+
}
|
585
|
+
/**
|
586
|
+
* Information about the item to be renamed.
|
587
|
+
*/
|
588
|
+
interface RenameInfo {
|
589
|
+
/**
|
590
|
+
* True if item can be renamed.
|
591
|
+
*/
|
592
|
+
canRename: boolean;
|
593
|
+
/**
|
594
|
+
* Error message if item can not be renamed.
|
595
|
+
*/
|
596
|
+
localizedErrorMessage?: string;
|
597
|
+
/**
|
598
|
+
* Display name of the item to be renamed.
|
599
|
+
*/
|
600
|
+
displayName: string;
|
601
|
+
/**
|
602
|
+
* Full display name of item to be renamed.
|
603
|
+
*/
|
604
|
+
fullDisplayName: string;
|
605
|
+
/**
|
606
|
+
* The items's kind (such as 'className' or 'parameterName' or plain 'text').
|
607
|
+
*/
|
608
|
+
kind: string;
|
609
|
+
/**
|
610
|
+
* Optional modifiers for the kind (such as 'public').
|
611
|
+
*/
|
612
|
+
kindModifiers: string;
|
613
|
+
}
|
614
|
+
/**
|
615
|
+
* A group of text spans, all in 'file'.
|
616
|
+
*/
|
617
|
+
interface SpanGroup {
|
618
|
+
/** The file to which the spans apply */
|
619
|
+
file: string;
|
620
|
+
/** The text spans in this group */
|
621
|
+
locs: TextSpan[];
|
622
|
+
}
|
623
|
+
interface RenameResponseBody {
|
624
|
+
/**
|
625
|
+
* Information about the item to be renamed.
|
626
|
+
*/
|
627
|
+
info: RenameInfo;
|
628
|
+
/**
|
629
|
+
* An array of span groups (one per file) that refer to the item to be renamed.
|
630
|
+
*/
|
631
|
+
locs: SpanGroup[];
|
632
|
+
}
|
633
|
+
/**
|
634
|
+
* Rename response message.
|
635
|
+
*/
|
636
|
+
interface RenameResponse extends Response {
|
637
|
+
body?: RenameResponseBody;
|
638
|
+
}
|
639
|
+
/**
|
640
|
+
* Represents a file in external project.
|
641
|
+
* External project is project whose set of files, compilation options and open\close state
|
642
|
+
* is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
|
643
|
+
* External project will exist even if all files in it are closed and should be closed explicity.
|
644
|
+
* If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
|
645
|
+
* create configured project for every config file but will maintain a link that these projects were created
|
646
|
+
* as a result of opening external project so they should be removed once external project is closed.
|
647
|
+
*/
|
648
|
+
interface ExternalFile {
|
649
|
+
/**
|
650
|
+
* Name of file file
|
651
|
+
*/
|
652
|
+
fileName: string;
|
653
|
+
/**
|
654
|
+
* Script kind of the file
|
655
|
+
*/
|
656
|
+
scriptKind?: ScriptKindName | ts.ScriptKind;
|
657
|
+
/**
|
658
|
+
* Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)
|
659
|
+
*/
|
660
|
+
hasMixedContent?: boolean;
|
661
|
+
/**
|
662
|
+
* Content of the file
|
663
|
+
*/
|
664
|
+
content?: string;
|
665
|
+
}
|
666
|
+
/**
|
667
|
+
* Represent an external project
|
668
|
+
*/
|
669
|
+
interface ExternalProject {
|
670
|
+
/**
|
671
|
+
* Project name
|
672
|
+
*/
|
673
|
+
projectFileName: string;
|
674
|
+
/**
|
675
|
+
* List of root files in project
|
676
|
+
*/
|
677
|
+
rootFiles: ExternalFile[];
|
678
|
+
/**
|
679
|
+
* Compiler options for the project
|
680
|
+
*/
|
681
|
+
options: ExternalProjectCompilerOptions;
|
682
|
+
/**
|
683
|
+
* @deprecated typingOptions. Use typeAcquisition instead
|
684
|
+
*/
|
685
|
+
typingOptions?: TypeAcquisition;
|
686
|
+
/**
|
687
|
+
* Explicitly specified type acquisition for the project
|
688
|
+
*/
|
689
|
+
typeAcquisition?: TypeAcquisition;
|
690
|
+
}
|
691
|
+
interface CompileOnSaveMixin {
|
692
|
+
/**
|
693
|
+
* If compile on save is enabled for the project
|
694
|
+
*/
|
695
|
+
compileOnSave?: boolean;
|
696
|
+
}
|
697
|
+
/**
|
698
|
+
* For external projects, some of the project settings are sent together with
|
699
|
+
* compiler settings.
|
700
|
+
*/
|
701
|
+
type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin;
|
702
|
+
/**
|
703
|
+
* Represents a set of changes that happen in project
|
704
|
+
*/
|
705
|
+
interface ProjectChanges {
|
706
|
+
/**
|
707
|
+
* List of added files
|
708
|
+
*/
|
709
|
+
added: string[];
|
710
|
+
/**
|
711
|
+
* List of removed files
|
712
|
+
*/
|
713
|
+
removed: string[];
|
714
|
+
/**
|
715
|
+
* List of updated files
|
716
|
+
*/
|
717
|
+
updated: string[];
|
718
|
+
}
|
719
|
+
/**
|
720
|
+
* Information found in a configure request.
|
721
|
+
*/
|
722
|
+
interface ConfigureRequestArguments {
|
723
|
+
/**
|
724
|
+
* Information about the host, for example 'Emacs 24.4' or
|
725
|
+
* 'Sublime Text version 3075'
|
726
|
+
*/
|
727
|
+
hostInfo?: string;
|
728
|
+
/**
|
729
|
+
* If present, tab settings apply only to this file.
|
730
|
+
*/
|
731
|
+
file?: string;
|
732
|
+
/**
|
733
|
+
* The format options to use during formatting and other code editing features.
|
734
|
+
*/
|
735
|
+
formatOptions?: FormatCodeSettings;
|
736
|
+
/**
|
737
|
+
* The host's additional supported file extensions
|
738
|
+
*/
|
739
|
+
extraFileExtensions?: FileExtensionInfo[];
|
740
|
+
}
|
741
|
+
/**
|
742
|
+
* Configure request; value of command field is "configure". Specifies
|
743
|
+
* host information, such as host type, tab size, and indent size.
|
744
|
+
*/
|
745
|
+
interface ConfigureRequest extends Request {
|
746
|
+
command: CommandTypes.Configure;
|
747
|
+
arguments: ConfigureRequestArguments;
|
748
|
+
}
|
749
|
+
/**
|
750
|
+
* Response to "configure" request. This is just an acknowledgement, so
|
751
|
+
* no body field is required.
|
752
|
+
*/
|
753
|
+
interface ConfigureResponse extends Response {
|
754
|
+
}
|
755
|
+
/**
|
756
|
+
* Information found in an "open" request.
|
757
|
+
*/
|
758
|
+
interface OpenRequestArgs extends FileRequestArgs {
|
759
|
+
/**
|
760
|
+
* Used when a version of the file content is known to be more up to date than the one on disk.
|
761
|
+
* Then the known content will be used upon opening instead of the disk copy
|
762
|
+
*/
|
763
|
+
fileContent?: string;
|
764
|
+
/**
|
765
|
+
* Used to specify the script kind of the file explicitly. It could be one of the following:
|
766
|
+
* "TS", "JS", "TSX", "JSX"
|
767
|
+
*/
|
768
|
+
scriptKindName?: ScriptKindName;
|
769
|
+
}
|
770
|
+
type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
|
771
|
+
/**
|
772
|
+
* Open request; value of command field is "open". Notify the
|
773
|
+
* server that the client has file open. The server will not
|
774
|
+
* monitor the filesystem for changes in this file and will assume
|
775
|
+
* that the client is updating the server (using the change and/or
|
776
|
+
* reload messages) when the file changes. Server does not currently
|
777
|
+
* send a response to an open request.
|
778
|
+
*/
|
779
|
+
interface OpenRequest extends Request {
|
780
|
+
command: CommandTypes.Open;
|
781
|
+
arguments: OpenRequestArgs;
|
782
|
+
}
|
783
|
+
/**
|
784
|
+
* Request to open or update external project
|
785
|
+
*/
|
786
|
+
interface OpenExternalProjectRequest extends Request {
|
787
|
+
command: CommandTypes.OpenExternalProject;
|
788
|
+
arguments: OpenExternalProjectArgs;
|
789
|
+
}
|
790
|
+
/**
|
791
|
+
* Arguments to OpenExternalProjectRequest request
|
792
|
+
*/
|
793
|
+
type OpenExternalProjectArgs = ExternalProject;
|
794
|
+
/**
|
795
|
+
* Request to open multiple external projects
|
796
|
+
*/
|
797
|
+
interface OpenExternalProjectsRequest extends Request {
|
798
|
+
command: CommandTypes.OpenExternalProjects;
|
799
|
+
arguments: OpenExternalProjectsArgs;
|
800
|
+
}
|
801
|
+
/**
|
802
|
+
* Arguments to OpenExternalProjectsRequest
|
803
|
+
*/
|
804
|
+
interface OpenExternalProjectsArgs {
|
805
|
+
/**
|
806
|
+
* List of external projects to open or update
|
807
|
+
*/
|
808
|
+
projects: ExternalProject[];
|
809
|
+
}
|
810
|
+
/**
|
811
|
+
* Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
|
812
|
+
* no body field is required.
|
813
|
+
*/
|
814
|
+
interface OpenExternalProjectResponse extends Response {
|
815
|
+
}
|
816
|
+
/**
|
817
|
+
* Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
|
818
|
+
* no body field is required.
|
819
|
+
*/
|
820
|
+
interface OpenExternalProjectsResponse extends Response {
|
821
|
+
}
|
822
|
+
/**
|
823
|
+
* Request to close external project.
|
824
|
+
*/
|
825
|
+
interface CloseExternalProjectRequest extends Request {
|
826
|
+
command: CommandTypes.CloseExternalProject;
|
827
|
+
arguments: CloseExternalProjectRequestArgs;
|
828
|
+
}
|
829
|
+
/**
|
830
|
+
* Arguments to CloseExternalProjectRequest request
|
831
|
+
*/
|
832
|
+
interface CloseExternalProjectRequestArgs {
|
833
|
+
/**
|
834
|
+
* Name of the project to close
|
835
|
+
*/
|
836
|
+
projectFileName: string;
|
837
|
+
}
|
838
|
+
/**
|
839
|
+
* Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
|
840
|
+
* no body field is required.
|
841
|
+
*/
|
842
|
+
interface CloseExternalProjectResponse extends Response {
|
843
|
+
}
|
844
|
+
/**
|
845
|
+
* Request to set compiler options for inferred projects.
|
846
|
+
* External projects are opened / closed explicitly.
|
847
|
+
* Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.
|
848
|
+
* This configuration file will be used to obtain a list of files and configuration settings for the project.
|
849
|
+
* Inferred projects are created when user opens a loose file that is not the part of external project
|
850
|
+
* or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
|
851
|
+
* or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
|
852
|
+
*/
|
853
|
+
interface SetCompilerOptionsForInferredProjectsRequest extends Request {
|
854
|
+
command: CommandTypes.CompilerOptionsForInferredProjects;
|
855
|
+
arguments: SetCompilerOptionsForInferredProjectsArgs;
|
856
|
+
}
|
857
|
+
/**
|
858
|
+
* Argument for SetCompilerOptionsForInferredProjectsRequest request.
|
859
|
+
*/
|
860
|
+
interface SetCompilerOptionsForInferredProjectsArgs {
|
861
|
+
/**
|
862
|
+
* Compiler options to be used with inferred projects.
|
863
|
+
*/
|
864
|
+
options: ExternalProjectCompilerOptions;
|
865
|
+
}
|
866
|
+
/**
|
867
|
+
* Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
|
868
|
+
* no body field is required.
|
869
|
+
*/
|
870
|
+
interface SetCompilerOptionsForInferredProjectsResponse extends Response {
|
871
|
+
}
|
872
|
+
/**
|
873
|
+
* Exit request; value of command field is "exit". Ask the server process
|
874
|
+
* to exit.
|
875
|
+
*/
|
876
|
+
interface ExitRequest extends Request {
|
877
|
+
command: CommandTypes.Exit;
|
878
|
+
}
|
879
|
+
/**
|
880
|
+
* Close request; value of command field is "close". Notify the
|
881
|
+
* server that the client has closed a previously open file. If
|
882
|
+
* file is still referenced by open files, the server will resume
|
883
|
+
* monitoring the filesystem for changes to file. Server does not
|
884
|
+
* currently send a response to a close request.
|
885
|
+
*/
|
886
|
+
interface CloseRequest extends FileRequest {
|
887
|
+
command: CommandTypes.Close;
|
888
|
+
}
|
889
|
+
/**
|
890
|
+
* Request to obtain the list of files that should be regenerated if target file is recompiled.
|
891
|
+
* NOTE: this us query-only operation and does not generate any output on disk.
|
892
|
+
*/
|
893
|
+
interface CompileOnSaveAffectedFileListRequest extends FileRequest {
|
894
|
+
command: CommandTypes.CompileOnSaveAffectedFileList;
|
895
|
+
}
|
896
|
+
/**
|
897
|
+
* Contains a list of files that should be regenerated in a project
|
898
|
+
*/
|
899
|
+
interface CompileOnSaveAffectedFileListSingleProject {
|
900
|
+
/**
|
901
|
+
* Project name
|
902
|
+
*/
|
903
|
+
projectFileName: string;
|
904
|
+
/**
|
905
|
+
* List of files names that should be recompiled
|
906
|
+
*/
|
907
|
+
fileNames: string[];
|
908
|
+
}
|
909
|
+
/**
|
910
|
+
* Response for CompileOnSaveAffectedFileListRequest request;
|
911
|
+
*/
|
912
|
+
interface CompileOnSaveAffectedFileListResponse extends Response {
|
913
|
+
body: CompileOnSaveAffectedFileListSingleProject[];
|
914
|
+
}
|
915
|
+
/**
|
916
|
+
* Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
|
917
|
+
*/
|
918
|
+
interface CompileOnSaveEmitFileRequest extends FileRequest {
|
919
|
+
command: CommandTypes.CompileOnSaveEmitFile;
|
920
|
+
arguments: CompileOnSaveEmitFileRequestArgs;
|
921
|
+
}
|
922
|
+
/**
|
923
|
+
* Arguments for CompileOnSaveEmitFileRequest
|
924
|
+
*/
|
925
|
+
interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
|
926
|
+
/**
|
927
|
+
* if true - then file should be recompiled even if it does not have any changes.
|
928
|
+
*/
|
929
|
+
forced?: boolean;
|
930
|
+
}
|
931
|
+
/**
|
932
|
+
* Quickinfo request; value of command field is
|
933
|
+
* "quickinfo". Return response giving a quick type and
|
934
|
+
* documentation string for the symbol found in file at location
|
935
|
+
* line, col.
|
936
|
+
*/
|
937
|
+
interface QuickInfoRequest extends FileLocationRequest {
|
938
|
+
command: CommandTypes.Quickinfo;
|
939
|
+
}
|
940
|
+
/**
|
941
|
+
* Body of QuickInfoResponse.
|
942
|
+
*/
|
943
|
+
interface QuickInfoResponseBody {
|
944
|
+
/**
|
945
|
+
* The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
|
946
|
+
*/
|
947
|
+
kind: string;
|
948
|
+
/**
|
949
|
+
* Optional modifiers for the kind (such as 'public').
|
950
|
+
*/
|
951
|
+
kindModifiers: string;
|
952
|
+
/**
|
953
|
+
* Starting file location of symbol.
|
954
|
+
*/
|
955
|
+
start: Location;
|
956
|
+
/**
|
957
|
+
* One past last character of symbol.
|
958
|
+
*/
|
959
|
+
end: Location;
|
960
|
+
/**
|
961
|
+
* Type and kind of symbol.
|
962
|
+
*/
|
963
|
+
displayString: string;
|
964
|
+
/**
|
965
|
+
* Documentation associated with symbol.
|
966
|
+
*/
|
967
|
+
documentation: string;
|
968
|
+
/**
|
969
|
+
* JSDoc tags associated with symbol.
|
970
|
+
*/
|
971
|
+
tags: JSDocTagInfo[];
|
972
|
+
}
|
973
|
+
/**
|
974
|
+
* Quickinfo response message.
|
975
|
+
*/
|
976
|
+
interface QuickInfoResponse extends Response {
|
977
|
+
body?: QuickInfoResponseBody;
|
978
|
+
}
|
979
|
+
/**
|
980
|
+
* Arguments for format messages.
|
981
|
+
*/
|
982
|
+
interface FormatRequestArgs extends FileLocationRequestArgs {
|
983
|
+
/**
|
984
|
+
* Last line of range for which to format text in file.
|
985
|
+
*/
|
986
|
+
endLine: number;
|
987
|
+
/**
|
988
|
+
* Character offset on last line of range for which to format text in file.
|
989
|
+
*/
|
990
|
+
endOffset: number;
|
991
|
+
/**
|
992
|
+
* Format options to be used.
|
993
|
+
*/
|
994
|
+
options?: FormatCodeSettings;
|
995
|
+
}
|
996
|
+
/**
|
997
|
+
* Format request; value of command field is "format". Return
|
998
|
+
* response giving zero or more edit instructions. The edit
|
999
|
+
* instructions will be sorted in file order. Applying the edit
|
1000
|
+
* instructions in reverse to file will result in correctly
|
1001
|
+
* reformatted text.
|
1002
|
+
*/
|
1003
|
+
interface FormatRequest extends FileLocationRequest {
|
1004
|
+
command: CommandTypes.Format;
|
1005
|
+
arguments: FormatRequestArgs;
|
1006
|
+
}
|
1007
|
+
/**
|
1008
|
+
* Object found in response messages defining an editing
|
1009
|
+
* instruction for a span of text in source code. The effect of
|
1010
|
+
* this instruction is to replace the text starting at start and
|
1011
|
+
* ending one character before end with newText. For an insertion,
|
1012
|
+
* the text span is empty. For a deletion, newText is empty.
|
1013
|
+
*/
|
1014
|
+
interface CodeEdit {
|
1015
|
+
/**
|
1016
|
+
* First character of the text span to edit.
|
1017
|
+
*/
|
1018
|
+
start: Location;
|
1019
|
+
/**
|
1020
|
+
* One character past last character of the text span to edit.
|
1021
|
+
*/
|
1022
|
+
end: Location;
|
1023
|
+
/**
|
1024
|
+
* Replace the span defined above with this string (may be
|
1025
|
+
* the empty string).
|
1026
|
+
*/
|
1027
|
+
newText: string;
|
1028
|
+
}
|
1029
|
+
interface FileCodeEdits {
|
1030
|
+
fileName: string;
|
1031
|
+
textChanges: CodeEdit[];
|
1032
|
+
}
|
1033
|
+
interface CodeFixResponse extends Response {
|
1034
|
+
/** The code actions that are available */
|
1035
|
+
body?: CodeAction[];
|
1036
|
+
}
|
1037
|
+
interface CodeAction {
|
1038
|
+
/** Description of the code action to display in the UI of the editor */
|
1039
|
+
description: string;
|
1040
|
+
/** Text changes to apply to each file as part of the code action */
|
1041
|
+
changes: FileCodeEdits[];
|
1042
|
+
}
|
1043
|
+
/**
|
1044
|
+
* Format and format on key response message.
|
1045
|
+
*/
|
1046
|
+
interface FormatResponse extends Response {
|
1047
|
+
body?: CodeEdit[];
|
1048
|
+
}
|
1049
|
+
/**
|
1050
|
+
* Arguments for format on key messages.
|
1051
|
+
*/
|
1052
|
+
interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
|
1053
|
+
/**
|
1054
|
+
* Key pressed (';', '\n', or '}').
|
1055
|
+
*/
|
1056
|
+
key: string;
|
1057
|
+
options?: FormatCodeSettings;
|
1058
|
+
}
|
1059
|
+
/**
|
1060
|
+
* Format on key request; value of command field is
|
1061
|
+
* "formatonkey". Given file location and key typed (as string),
|
1062
|
+
* return response giving zero or more edit instructions. The
|
1063
|
+
* edit instructions will be sorted in file order. Applying the
|
1064
|
+
* edit instructions in reverse to file will result in correctly
|
1065
|
+
* reformatted text.
|
1066
|
+
*/
|
1067
|
+
interface FormatOnKeyRequest extends FileLocationRequest {
|
1068
|
+
command: CommandTypes.Formatonkey;
|
1069
|
+
arguments: FormatOnKeyRequestArgs;
|
1070
|
+
}
|
1071
|
+
/**
|
1072
|
+
* Arguments for completions messages.
|
1073
|
+
*/
|
1074
|
+
interface CompletionsRequestArgs extends FileLocationRequestArgs {
|
1075
|
+
/**
|
1076
|
+
* Optional prefix to apply to possible completions.
|
1077
|
+
*/
|
1078
|
+
prefix?: string;
|
1079
|
+
}
|
1080
|
+
/**
|
1081
|
+
* Completions request; value of command field is "completions".
|
1082
|
+
* Given a file location (file, line, col) and a prefix (which may
|
1083
|
+
* be the empty string), return the possible completions that
|
1084
|
+
* begin with prefix.
|
1085
|
+
*/
|
1086
|
+
interface CompletionsRequest extends FileLocationRequest {
|
1087
|
+
command: CommandTypes.Completions;
|
1088
|
+
arguments: CompletionsRequestArgs;
|
1089
|
+
}
|
1090
|
+
/**
|
1091
|
+
* Arguments for completion details request.
|
1092
|
+
*/
|
1093
|
+
interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
|
1094
|
+
/**
|
1095
|
+
* Names of one or more entries for which to obtain details.
|
1096
|
+
*/
|
1097
|
+
entryNames: string[];
|
1098
|
+
}
|
1099
|
+
/**
|
1100
|
+
* Completion entry details request; value of command field is
|
1101
|
+
* "completionEntryDetails". Given a file location (file, line,
|
1102
|
+
* col) and an array of completion entry names return more
|
1103
|
+
* detailed information for each completion entry.
|
1104
|
+
*/
|
1105
|
+
interface CompletionDetailsRequest extends FileLocationRequest {
|
1106
|
+
command: CommandTypes.CompletionDetails;
|
1107
|
+
arguments: CompletionDetailsRequestArgs;
|
1108
|
+
}
|
1109
|
+
/**
|
1110
|
+
* Part of a symbol description.
|
1111
|
+
*/
|
1112
|
+
interface SymbolDisplayPart {
|
1113
|
+
/**
|
1114
|
+
* Text of an item describing the symbol.
|
1115
|
+
*/
|
1116
|
+
text: string;
|
1117
|
+
/**
|
1118
|
+
* The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
|
1119
|
+
*/
|
1120
|
+
kind: string;
|
1121
|
+
}
|
1122
|
+
/**
|
1123
|
+
* An item found in a completion response.
|
1124
|
+
*/
|
1125
|
+
interface CompletionEntry {
|
1126
|
+
/**
|
1127
|
+
* The symbol's name.
|
1128
|
+
*/
|
1129
|
+
name: string;
|
1130
|
+
/**
|
1131
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
1132
|
+
*/
|
1133
|
+
kind: string;
|
1134
|
+
/**
|
1135
|
+
* Optional modifiers for the kind (such as 'public').
|
1136
|
+
*/
|
1137
|
+
kindModifiers: string;
|
1138
|
+
/**
|
1139
|
+
* A string that is used for comparing completion items so that they can be ordered. This
|
1140
|
+
* is often the same as the name but may be different in certain circumstances.
|
1141
|
+
*/
|
1142
|
+
sortText: string;
|
1143
|
+
/**
|
1144
|
+
* An optional span that indicates the text to be replaced by this completion item. If present,
|
1145
|
+
* this span should be used instead of the default one.
|
1146
|
+
*/
|
1147
|
+
replacementSpan?: TextSpan;
|
1148
|
+
}
|
1149
|
+
/**
|
1150
|
+
* Additional completion entry details, available on demand
|
1151
|
+
*/
|
1152
|
+
interface CompletionEntryDetails {
|
1153
|
+
/**
|
1154
|
+
* The symbol's name.
|
1155
|
+
*/
|
1156
|
+
name: string;
|
1157
|
+
/**
|
1158
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
1159
|
+
*/
|
1160
|
+
kind: string;
|
1161
|
+
/**
|
1162
|
+
* Optional modifiers for the kind (such as 'public').
|
1163
|
+
*/
|
1164
|
+
kindModifiers: string;
|
1165
|
+
/**
|
1166
|
+
* Display parts of the symbol (similar to quick info).
|
1167
|
+
*/
|
1168
|
+
displayParts: SymbolDisplayPart[];
|
1169
|
+
/**
|
1170
|
+
* Documentation strings for the symbol.
|
1171
|
+
*/
|
1172
|
+
documentation: SymbolDisplayPart[];
|
1173
|
+
/**
|
1174
|
+
* JSDoc tags for the symbol.
|
1175
|
+
*/
|
1176
|
+
tags: JSDocTagInfo[];
|
1177
|
+
}
|
1178
|
+
interface CompletionsResponse extends Response {
|
1179
|
+
body?: CompletionEntry[];
|
1180
|
+
}
|
1181
|
+
interface CompletionDetailsResponse extends Response {
|
1182
|
+
body?: CompletionEntryDetails[];
|
1183
|
+
}
|
1184
|
+
/**
|
1185
|
+
* Signature help information for a single parameter
|
1186
|
+
*/
|
1187
|
+
interface SignatureHelpParameter {
|
1188
|
+
/**
|
1189
|
+
* The parameter's name
|
1190
|
+
*/
|
1191
|
+
name: string;
|
1192
|
+
/**
|
1193
|
+
* Documentation of the parameter.
|
1194
|
+
*/
|
1195
|
+
documentation: SymbolDisplayPart[];
|
1196
|
+
/**
|
1197
|
+
* Display parts of the parameter.
|
1198
|
+
*/
|
1199
|
+
displayParts: SymbolDisplayPart[];
|
1200
|
+
/**
|
1201
|
+
* Whether the parameter is optional or not.
|
1202
|
+
*/
|
1203
|
+
isOptional: boolean;
|
1204
|
+
}
|
1205
|
+
/**
|
1206
|
+
* Represents a single signature to show in signature help.
|
1207
|
+
*/
|
1208
|
+
interface SignatureHelpItem {
|
1209
|
+
/**
|
1210
|
+
* Whether the signature accepts a variable number of arguments.
|
1211
|
+
*/
|
1212
|
+
isVariadic: boolean;
|
1213
|
+
/**
|
1214
|
+
* The prefix display parts.
|
1215
|
+
*/
|
1216
|
+
prefixDisplayParts: SymbolDisplayPart[];
|
1217
|
+
/**
|
1218
|
+
* The suffix display parts.
|
1219
|
+
*/
|
1220
|
+
suffixDisplayParts: SymbolDisplayPart[];
|
1221
|
+
/**
|
1222
|
+
* The separator display parts.
|
1223
|
+
*/
|
1224
|
+
separatorDisplayParts: SymbolDisplayPart[];
|
1225
|
+
/**
|
1226
|
+
* The signature helps items for the parameters.
|
1227
|
+
*/
|
1228
|
+
parameters: SignatureHelpParameter[];
|
1229
|
+
/**
|
1230
|
+
* The signature's documentation
|
1231
|
+
*/
|
1232
|
+
documentation: SymbolDisplayPart[];
|
1233
|
+
/**
|
1234
|
+
* The signature's JSDoc tags
|
1235
|
+
*/
|
1236
|
+
tags: JSDocTagInfo[];
|
1237
|
+
}
|
1238
|
+
/**
|
1239
|
+
* Signature help items found in the response of a signature help request.
|
1240
|
+
*/
|
1241
|
+
interface SignatureHelpItems {
|
1242
|
+
/**
|
1243
|
+
* The signature help items.
|
1244
|
+
*/
|
1245
|
+
items: SignatureHelpItem[];
|
1246
|
+
/**
|
1247
|
+
* The span for which signature help should appear on a signature
|
1248
|
+
*/
|
1249
|
+
applicableSpan: TextSpan;
|
1250
|
+
/**
|
1251
|
+
* The item selected in the set of available help items.
|
1252
|
+
*/
|
1253
|
+
selectedItemIndex: number;
|
1254
|
+
/**
|
1255
|
+
* The argument selected in the set of parameters.
|
1256
|
+
*/
|
1257
|
+
argumentIndex: number;
|
1258
|
+
/**
|
1259
|
+
* The argument count
|
1260
|
+
*/
|
1261
|
+
argumentCount: number;
|
1262
|
+
}
|
1263
|
+
/**
|
1264
|
+
* Arguments of a signature help request.
|
1265
|
+
*/
|
1266
|
+
interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
|
1267
|
+
}
|
1268
|
+
/**
|
1269
|
+
* Signature help request; value of command field is "signatureHelp".
|
1270
|
+
* Given a file location (file, line, col), return the signature
|
1271
|
+
* help.
|
1272
|
+
*/
|
1273
|
+
interface SignatureHelpRequest extends FileLocationRequest {
|
1274
|
+
command: CommandTypes.SignatureHelp;
|
1275
|
+
arguments: SignatureHelpRequestArgs;
|
1276
|
+
}
|
1277
|
+
/**
|
1278
|
+
* Response object for a SignatureHelpRequest.
|
1279
|
+
*/
|
1280
|
+
interface SignatureHelpResponse extends Response {
|
1281
|
+
body?: SignatureHelpItems;
|
1282
|
+
}
|
1283
|
+
/**
|
1284
|
+
* Synchronous request for semantic diagnostics of one file.
|
1285
|
+
*/
|
1286
|
+
interface SemanticDiagnosticsSyncRequest extends FileRequest {
|
1287
|
+
command: CommandTypes.SemanticDiagnosticsSync;
|
1288
|
+
arguments: SemanticDiagnosticsSyncRequestArgs;
|
1289
|
+
}
|
1290
|
+
interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
|
1291
|
+
includeLinePosition?: boolean;
|
1292
|
+
}
|
1293
|
+
/**
|
1294
|
+
* Response object for synchronous sematic diagnostics request.
|
1295
|
+
*/
|
1296
|
+
interface SemanticDiagnosticsSyncResponse extends Response {
|
1297
|
+
body?: Diagnostic[] | DiagnosticWithLinePosition[];
|
1298
|
+
}
|
1299
|
+
/**
|
1300
|
+
* Synchronous request for syntactic diagnostics of one file.
|
1301
|
+
*/
|
1302
|
+
interface SyntacticDiagnosticsSyncRequest extends FileRequest {
|
1303
|
+
command: CommandTypes.SyntacticDiagnosticsSync;
|
1304
|
+
arguments: SyntacticDiagnosticsSyncRequestArgs;
|
1305
|
+
}
|
1306
|
+
interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
|
1307
|
+
includeLinePosition?: boolean;
|
1308
|
+
}
|
1309
|
+
/**
|
1310
|
+
* Response object for synchronous syntactic diagnostics request.
|
1311
|
+
*/
|
1312
|
+
interface SyntacticDiagnosticsSyncResponse extends Response {
|
1313
|
+
body?: Diagnostic[] | DiagnosticWithLinePosition[];
|
1314
|
+
}
|
1315
|
+
/**
|
1316
|
+
* Arguments for GeterrForProject request.
|
1317
|
+
*/
|
1318
|
+
interface GeterrForProjectRequestArgs {
|
1319
|
+
/**
|
1320
|
+
* the file requesting project error list
|
1321
|
+
*/
|
1322
|
+
file: string;
|
1323
|
+
/**
|
1324
|
+
* Delay in milliseconds to wait before starting to compute
|
1325
|
+
* errors for the files in the file list
|
1326
|
+
*/
|
1327
|
+
delay: number;
|
1328
|
+
}
|
1329
|
+
/**
|
1330
|
+
* GeterrForProjectRequest request; value of command field is
|
1331
|
+
* "geterrForProject". It works similarly with 'Geterr', only
|
1332
|
+
* it request for every file in this project.
|
1333
|
+
*/
|
1334
|
+
interface GeterrForProjectRequest extends Request {
|
1335
|
+
command: CommandTypes.GeterrForProject;
|
1336
|
+
arguments: GeterrForProjectRequestArgs;
|
1337
|
+
}
|
1338
|
+
/**
|
1339
|
+
* Arguments for geterr messages.
|
1340
|
+
*/
|
1341
|
+
interface GeterrRequestArgs {
|
1342
|
+
/**
|
1343
|
+
* List of file names for which to compute compiler errors.
|
1344
|
+
* The files will be checked in list order.
|
1345
|
+
*/
|
1346
|
+
files: string[];
|
1347
|
+
/**
|
1348
|
+
* Delay in milliseconds to wait before starting to compute
|
1349
|
+
* errors for the files in the file list
|
1350
|
+
*/
|
1351
|
+
delay: number;
|
1352
|
+
}
|
1353
|
+
/**
|
1354
|
+
* Geterr request; value of command field is "geterr". Wait for
|
1355
|
+
* delay milliseconds and then, if during the wait no change or
|
1356
|
+
* reload messages have arrived for the first file in the files
|
1357
|
+
* list, get the syntactic errors for the file, field requests,
|
1358
|
+
* and then get the semantic errors for the file. Repeat with a
|
1359
|
+
* smaller delay for each subsequent file on the files list. Best
|
1360
|
+
* practice for an editor is to send a file list containing each
|
1361
|
+
* file that is currently visible, in most-recently-used order.
|
1362
|
+
*/
|
1363
|
+
interface GeterrRequest extends Request {
|
1364
|
+
command: CommandTypes.Geterr;
|
1365
|
+
arguments: GeterrRequestArgs;
|
1366
|
+
}
|
1367
|
+
/**
|
1368
|
+
* Item of diagnostic information found in a DiagnosticEvent message.
|
1369
|
+
*/
|
1370
|
+
interface Diagnostic {
|
1371
|
+
/**
|
1372
|
+
* Starting file location at which text applies.
|
1373
|
+
*/
|
1374
|
+
start: Location;
|
1375
|
+
/**
|
1376
|
+
* The last file location at which the text applies.
|
1377
|
+
*/
|
1378
|
+
end: Location;
|
1379
|
+
/**
|
1380
|
+
* Text of diagnostic message.
|
1381
|
+
*/
|
1382
|
+
text: string;
|
1383
|
+
/**
|
1384
|
+
* The error code of the diagnostic message.
|
1385
|
+
*/
|
1386
|
+
code?: number;
|
1387
|
+
}
|
1388
|
+
interface DiagnosticEventBody {
|
1389
|
+
/**
|
1390
|
+
* The file for which diagnostic information is reported.
|
1391
|
+
*/
|
1392
|
+
file: string;
|
1393
|
+
/**
|
1394
|
+
* An array of diagnostic information items.
|
1395
|
+
*/
|
1396
|
+
diagnostics: Diagnostic[];
|
1397
|
+
}
|
1398
|
+
/**
|
1399
|
+
* Event message for "syntaxDiag" and "semanticDiag" event types.
|
1400
|
+
* These events provide syntactic and semantic errors for a file.
|
1401
|
+
*/
|
1402
|
+
interface DiagnosticEvent extends Event {
|
1403
|
+
body?: DiagnosticEventBody;
|
1404
|
+
}
|
1405
|
+
interface ConfigFileDiagnosticEventBody {
|
1406
|
+
/**
|
1407
|
+
* The file which trigged the searching and error-checking of the config file
|
1408
|
+
*/
|
1409
|
+
triggerFile: string;
|
1410
|
+
/**
|
1411
|
+
* The name of the found config file.
|
1412
|
+
*/
|
1413
|
+
configFile: string;
|
1414
|
+
/**
|
1415
|
+
* An arry of diagnostic information items for the found config file.
|
1416
|
+
*/
|
1417
|
+
diagnostics: Diagnostic[];
|
1418
|
+
}
|
1419
|
+
/**
|
1420
|
+
* Event message for "configFileDiag" event type.
|
1421
|
+
* This event provides errors for a found config file.
|
1422
|
+
*/
|
1423
|
+
interface ConfigFileDiagnosticEvent extends Event {
|
1424
|
+
body?: ConfigFileDiagnosticEventBody;
|
1425
|
+
event: "configFileDiag";
|
1426
|
+
}
|
1427
|
+
type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
|
1428
|
+
interface ProjectLanguageServiceStateEvent extends Event {
|
1429
|
+
event: ProjectLanguageServiceStateEventName;
|
1430
|
+
body?: ProjectLanguageServiceStateEventBody;
|
1431
|
+
}
|
1432
|
+
interface ProjectLanguageServiceStateEventBody {
|
1433
|
+
/**
|
1434
|
+
* Project name that has changes in the state of language service.
|
1435
|
+
* For configured projects this will be the config file path.
|
1436
|
+
* For external projects this will be the name of the projects specified when project was open.
|
1437
|
+
* For inferred projects this event is not raised.
|
1438
|
+
*/
|
1439
|
+
projectName: string;
|
1440
|
+
/**
|
1441
|
+
* True if language service state switched from disabled to enabled
|
1442
|
+
* and false otherwise.
|
1443
|
+
*/
|
1444
|
+
languageServiceEnabled: boolean;
|
1445
|
+
}
|
1446
|
+
/**
|
1447
|
+
* Arguments for reload request.
|
1448
|
+
*/
|
1449
|
+
interface ReloadRequestArgs extends FileRequestArgs {
|
1450
|
+
/**
|
1451
|
+
* Name of temporary file from which to reload file
|
1452
|
+
* contents. May be same as file.
|
1453
|
+
*/
|
1454
|
+
tmpfile: string;
|
1455
|
+
}
|
1456
|
+
/**
|
1457
|
+
* Reload request message; value of command field is "reload".
|
1458
|
+
* Reload contents of file with name given by the 'file' argument
|
1459
|
+
* from temporary file with name given by the 'tmpfile' argument.
|
1460
|
+
* The two names can be identical.
|
1461
|
+
*/
|
1462
|
+
interface ReloadRequest extends FileRequest {
|
1463
|
+
command: CommandTypes.Reload;
|
1464
|
+
arguments: ReloadRequestArgs;
|
1465
|
+
}
|
1466
|
+
/**
|
1467
|
+
* Response to "reload" request. This is just an acknowledgement, so
|
1468
|
+
* no body field is required.
|
1469
|
+
*/
|
1470
|
+
interface ReloadResponse extends Response {
|
1471
|
+
}
|
1472
|
+
/**
|
1473
|
+
* Arguments for saveto request.
|
1474
|
+
*/
|
1475
|
+
interface SavetoRequestArgs extends FileRequestArgs {
|
1476
|
+
/**
|
1477
|
+
* Name of temporary file into which to save server's view of
|
1478
|
+
* file contents.
|
1479
|
+
*/
|
1480
|
+
tmpfile: string;
|
1481
|
+
}
|
1482
|
+
/**
|
1483
|
+
* Saveto request message; value of command field is "saveto".
|
1484
|
+
* For debugging purposes, save to a temporaryfile (named by
|
1485
|
+
* argument 'tmpfile') the contents of file named by argument
|
1486
|
+
* 'file'. The server does not currently send a response to a
|
1487
|
+
* "saveto" request.
|
1488
|
+
*/
|
1489
|
+
interface SavetoRequest extends FileRequest {
|
1490
|
+
command: CommandTypes.Saveto;
|
1491
|
+
arguments: SavetoRequestArgs;
|
1492
|
+
}
|
1493
|
+
/**
|
1494
|
+
* Arguments for navto request message.
|
1495
|
+
*/
|
1496
|
+
interface NavtoRequestArgs extends FileRequestArgs {
|
1497
|
+
/**
|
1498
|
+
* Search term to navigate to from current location; term can
|
1499
|
+
* be '.*' or an identifier prefix.
|
1500
|
+
*/
|
1501
|
+
searchValue: string;
|
1502
|
+
/**
|
1503
|
+
* Optional limit on the number of items to return.
|
1504
|
+
*/
|
1505
|
+
maxResultCount?: number;
|
1506
|
+
/**
|
1507
|
+
* Optional flag to indicate we want results for just the current file
|
1508
|
+
* or the entire project.
|
1509
|
+
*/
|
1510
|
+
currentFileOnly?: boolean;
|
1511
|
+
projectFileName?: string;
|
1512
|
+
}
|
1513
|
+
/**
|
1514
|
+
* Navto request message; value of command field is "navto".
|
1515
|
+
* Return list of objects giving file locations and symbols that
|
1516
|
+
* match the search term given in argument 'searchTerm'. The
|
1517
|
+
* context for the search is given by the named file.
|
1518
|
+
*/
|
1519
|
+
interface NavtoRequest extends FileRequest {
|
1520
|
+
command: CommandTypes.Navto;
|
1521
|
+
arguments: NavtoRequestArgs;
|
1522
|
+
}
|
1523
|
+
/**
|
1524
|
+
* An item found in a navto response.
|
1525
|
+
*/
|
1526
|
+
interface NavtoItem {
|
1527
|
+
/**
|
1528
|
+
* The symbol's name.
|
1529
|
+
*/
|
1530
|
+
name: string;
|
1531
|
+
/**
|
1532
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
1533
|
+
*/
|
1534
|
+
kind: string;
|
1535
|
+
/**
|
1536
|
+
* exact, substring, or prefix.
|
1537
|
+
*/
|
1538
|
+
matchKind?: string;
|
1539
|
+
/**
|
1540
|
+
* If this was a case sensitive or insensitive match.
|
1541
|
+
*/
|
1542
|
+
isCaseSensitive?: boolean;
|
1543
|
+
/**
|
1544
|
+
* Optional modifiers for the kind (such as 'public').
|
1545
|
+
*/
|
1546
|
+
kindModifiers?: string;
|
1547
|
+
/**
|
1548
|
+
* The file in which the symbol is found.
|
1549
|
+
*/
|
1550
|
+
file: string;
|
1551
|
+
/**
|
1552
|
+
* The location within file at which the symbol is found.
|
1553
|
+
*/
|
1554
|
+
start: Location;
|
1555
|
+
/**
|
1556
|
+
* One past the last character of the symbol.
|
1557
|
+
*/
|
1558
|
+
end: Location;
|
1559
|
+
/**
|
1560
|
+
* Name of symbol's container symbol (if any); for example,
|
1561
|
+
* the class name if symbol is a class member.
|
1562
|
+
*/
|
1563
|
+
containerName?: string;
|
1564
|
+
/**
|
1565
|
+
* Kind of symbol's container symbol (if any).
|
1566
|
+
*/
|
1567
|
+
containerKind?: string;
|
1568
|
+
}
|
1569
|
+
/**
|
1570
|
+
* Navto response message. Body is an array of navto items. Each
|
1571
|
+
* item gives a symbol that matched the search term.
|
1572
|
+
*/
|
1573
|
+
interface NavtoResponse extends Response {
|
1574
|
+
body?: NavtoItem[];
|
1575
|
+
}
|
1576
|
+
/**
|
1577
|
+
* Arguments for change request message.
|
1578
|
+
*/
|
1579
|
+
interface ChangeRequestArgs extends FormatRequestArgs {
|
1580
|
+
/**
|
1581
|
+
* Optional string to insert at location (file, line, offset).
|
1582
|
+
*/
|
1583
|
+
insertString?: string;
|
1584
|
+
}
|
1585
|
+
/**
|
1586
|
+
* Change request message; value of command field is "change".
|
1587
|
+
* Update the server's view of the file named by argument 'file'.
|
1588
|
+
* Server does not currently send a response to a change request.
|
1589
|
+
*/
|
1590
|
+
interface ChangeRequest extends FileLocationRequest {
|
1591
|
+
command: CommandTypes.Change;
|
1592
|
+
arguments: ChangeRequestArgs;
|
1593
|
+
}
|
1594
|
+
/**
|
1595
|
+
* Response to "brace" request.
|
1596
|
+
*/
|
1597
|
+
interface BraceResponse extends Response {
|
1598
|
+
body?: TextSpan[];
|
1599
|
+
}
|
1600
|
+
/**
|
1601
|
+
* Brace matching request; value of command field is "brace".
|
1602
|
+
* Return response giving the file locations of matching braces
|
1603
|
+
* found in file at location line, offset.
|
1604
|
+
*/
|
1605
|
+
interface BraceRequest extends FileLocationRequest {
|
1606
|
+
command: CommandTypes.Brace;
|
1607
|
+
}
|
1608
|
+
/**
|
1609
|
+
* NavBar items request; value of command field is "navbar".
|
1610
|
+
* Return response giving the list of navigation bar entries
|
1611
|
+
* extracted from the requested file.
|
1612
|
+
*/
|
1613
|
+
interface NavBarRequest extends FileRequest {
|
1614
|
+
command: CommandTypes.NavBar;
|
1615
|
+
}
|
1616
|
+
/**
|
1617
|
+
* NavTree request; value of command field is "navtree".
|
1618
|
+
* Return response giving the navigation tree of the requested file.
|
1619
|
+
*/
|
1620
|
+
interface NavTreeRequest extends FileRequest {
|
1621
|
+
command: CommandTypes.NavTree;
|
1622
|
+
}
|
1623
|
+
interface NavigationBarItem {
|
1624
|
+
/**
|
1625
|
+
* The item's display text.
|
1626
|
+
*/
|
1627
|
+
text: string;
|
1628
|
+
/**
|
1629
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
1630
|
+
*/
|
1631
|
+
kind: string;
|
1632
|
+
/**
|
1633
|
+
* Optional modifiers for the kind (such as 'public').
|
1634
|
+
*/
|
1635
|
+
kindModifiers?: string;
|
1636
|
+
/**
|
1637
|
+
* The definition locations of the item.
|
1638
|
+
*/
|
1639
|
+
spans: TextSpan[];
|
1640
|
+
/**
|
1641
|
+
* Optional children.
|
1642
|
+
*/
|
1643
|
+
childItems?: NavigationBarItem[];
|
1644
|
+
/**
|
1645
|
+
* Number of levels deep this item should appear.
|
1646
|
+
*/
|
1647
|
+
indent: number;
|
1648
|
+
}
|
1649
|
+
/** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
|
1650
|
+
interface NavigationTree {
|
1651
|
+
text: string;
|
1652
|
+
kind: string;
|
1653
|
+
kindModifiers: string;
|
1654
|
+
spans: TextSpan[];
|
1655
|
+
childItems?: NavigationTree[];
|
1656
|
+
}
|
1657
|
+
type TelemetryEventName = "telemetry";
|
1658
|
+
interface TelemetryEvent extends Event {
|
1659
|
+
event: TelemetryEventName;
|
1660
|
+
body: TelemetryEventBody;
|
1661
|
+
}
|
1662
|
+
interface TelemetryEventBody {
|
1663
|
+
telemetryEventName: string;
|
1664
|
+
payload: any;
|
1665
|
+
}
|
1666
|
+
type TypingsInstalledTelemetryEventName = "typingsInstalled";
|
1667
|
+
interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
|
1668
|
+
telemetryEventName: TypingsInstalledTelemetryEventName;
|
1669
|
+
payload: TypingsInstalledTelemetryEventPayload;
|
1670
|
+
}
|
1671
|
+
interface TypingsInstalledTelemetryEventPayload {
|
1672
|
+
/**
|
1673
|
+
* Comma separated list of installed typing packages
|
1674
|
+
*/
|
1675
|
+
installedPackages: string;
|
1676
|
+
/**
|
1677
|
+
* true if install request succeeded, otherwise - false
|
1678
|
+
*/
|
1679
|
+
installSuccess: boolean;
|
1680
|
+
/**
|
1681
|
+
* version of typings installer
|
1682
|
+
*/
|
1683
|
+
typingsInstallerVersion: string;
|
1684
|
+
}
|
1685
|
+
type BeginInstallTypesEventName = "beginInstallTypes";
|
1686
|
+
type EndInstallTypesEventName = "endInstallTypes";
|
1687
|
+
interface BeginInstallTypesEvent extends Event {
|
1688
|
+
event: BeginInstallTypesEventName;
|
1689
|
+
body: BeginInstallTypesEventBody;
|
1690
|
+
}
|
1691
|
+
interface EndInstallTypesEvent extends Event {
|
1692
|
+
event: EndInstallTypesEventName;
|
1693
|
+
body: EndInstallTypesEventBody;
|
1694
|
+
}
|
1695
|
+
interface InstallTypesEventBody {
|
1696
|
+
/**
|
1697
|
+
* correlation id to match begin and end events
|
1698
|
+
*/
|
1699
|
+
eventId: number;
|
1700
|
+
/**
|
1701
|
+
* list of packages to install
|
1702
|
+
*/
|
1703
|
+
packages: ReadonlyArray<string>;
|
1704
|
+
}
|
1705
|
+
interface BeginInstallTypesEventBody extends InstallTypesEventBody {
|
1706
|
+
}
|
1707
|
+
interface EndInstallTypesEventBody extends InstallTypesEventBody {
|
1708
|
+
/**
|
1709
|
+
* true if installation succeeded, otherwise false
|
1710
|
+
*/
|
1711
|
+
success: boolean;
|
1712
|
+
}
|
1713
|
+
interface NavBarResponse extends Response {
|
1714
|
+
body?: NavigationBarItem[];
|
1715
|
+
}
|
1716
|
+
interface NavTreeResponse extends Response {
|
1717
|
+
body?: NavigationTree;
|
1718
|
+
}
|
1719
|
+
namespace IndentStyle {
|
1720
|
+
type None = "None";
|
1721
|
+
type Block = "Block";
|
1722
|
+
type Smart = "Smart";
|
1723
|
+
}
|
1724
|
+
type IndentStyle = IndentStyle.None | IndentStyle.Block | IndentStyle.Smart;
|
1725
|
+
interface EditorSettings {
|
1726
|
+
baseIndentSize?: number;
|
1727
|
+
indentSize?: number;
|
1728
|
+
tabSize?: number;
|
1729
|
+
newLineCharacter?: string;
|
1730
|
+
convertTabsToSpaces?: boolean;
|
1731
|
+
indentStyle?: IndentStyle | ts.IndentStyle;
|
1732
|
+
}
|
1733
|
+
interface FormatCodeSettings extends EditorSettings {
|
1734
|
+
insertSpaceAfterCommaDelimiter?: boolean;
|
1735
|
+
insertSpaceAfterSemicolonInForStatements?: boolean;
|
1736
|
+
insertSpaceBeforeAndAfterBinaryOperators?: boolean;
|
1737
|
+
insertSpaceAfterConstructor?: boolean;
|
1738
|
+
insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
|
1739
|
+
insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
|
1740
|
+
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
|
1741
|
+
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
|
1742
|
+
insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
|
1743
|
+
insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
|
1744
|
+
insertSpaceBeforeFunctionParenthesis?: boolean;
|
1745
|
+
placeOpenBraceOnNewLineForFunctions?: boolean;
|
1746
|
+
placeOpenBraceOnNewLineForControlBlocks?: boolean;
|
1747
|
+
}
|
1748
|
+
interface CompilerOptions {
|
1749
|
+
allowJs?: boolean;
|
1750
|
+
allowSyntheticDefaultImports?: boolean;
|
1751
|
+
allowUnreachableCode?: boolean;
|
1752
|
+
allowUnusedLabels?: boolean;
|
1753
|
+
baseUrl?: string;
|
1754
|
+
charset?: string;
|
1755
|
+
declaration?: boolean;
|
1756
|
+
declarationDir?: string;
|
1757
|
+
disableSizeLimit?: boolean;
|
1758
|
+
emitBOM?: boolean;
|
1759
|
+
emitDecoratorMetadata?: boolean;
|
1760
|
+
experimentalDecorators?: boolean;
|
1761
|
+
forceConsistentCasingInFileNames?: boolean;
|
1762
|
+
inlineSourceMap?: boolean;
|
1763
|
+
inlineSources?: boolean;
|
1764
|
+
isolatedModules?: boolean;
|
1765
|
+
jsx?: JsxEmit | ts.JsxEmit;
|
1766
|
+
lib?: string[];
|
1767
|
+
locale?: string;
|
1768
|
+
mapRoot?: string;
|
1769
|
+
maxNodeModuleJsDepth?: number;
|
1770
|
+
module?: ModuleKind | ts.ModuleKind;
|
1771
|
+
moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
|
1772
|
+
newLine?: NewLineKind | ts.NewLineKind;
|
1773
|
+
noEmit?: boolean;
|
1774
|
+
noEmitHelpers?: boolean;
|
1775
|
+
noEmitOnError?: boolean;
|
1776
|
+
noErrorTruncation?: boolean;
|
1777
|
+
noFallthroughCasesInSwitch?: boolean;
|
1778
|
+
noImplicitAny?: boolean;
|
1779
|
+
noImplicitReturns?: boolean;
|
1780
|
+
noImplicitThis?: boolean;
|
1781
|
+
noUnusedLocals?: boolean;
|
1782
|
+
noUnusedParameters?: boolean;
|
1783
|
+
noImplicitUseStrict?: boolean;
|
1784
|
+
noLib?: boolean;
|
1785
|
+
noResolve?: boolean;
|
1786
|
+
out?: string;
|
1787
|
+
outDir?: string;
|
1788
|
+
outFile?: string;
|
1789
|
+
paths?: MapLike<string[]>;
|
1790
|
+
preserveConstEnums?: boolean;
|
1791
|
+
project?: string;
|
1792
|
+
reactNamespace?: string;
|
1793
|
+
removeComments?: boolean;
|
1794
|
+
rootDir?: string;
|
1795
|
+
rootDirs?: string[];
|
1796
|
+
skipLibCheck?: boolean;
|
1797
|
+
skipDefaultLibCheck?: boolean;
|
1798
|
+
sourceMap?: boolean;
|
1799
|
+
sourceRoot?: string;
|
1800
|
+
strictNullChecks?: boolean;
|
1801
|
+
suppressExcessPropertyErrors?: boolean;
|
1802
|
+
suppressImplicitAnyIndexErrors?: boolean;
|
1803
|
+
target?: ScriptTarget | ts.ScriptTarget;
|
1804
|
+
traceResolution?: boolean;
|
1805
|
+
types?: string[];
|
1806
|
+
/** Paths used to used to compute primary types search locations */
|
1807
|
+
typeRoots?: string[];
|
1808
|
+
[option: string]: CompilerOptionsValue | undefined;
|
1809
|
+
}
|
1810
|
+
namespace JsxEmit {
|
1811
|
+
type None = "None";
|
1812
|
+
type Preserve = "Preserve";
|
1813
|
+
type React = "React";
|
1814
|
+
}
|
1815
|
+
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React;
|
1816
|
+
namespace ModuleKind {
|
1817
|
+
type None = "None";
|
1818
|
+
type CommonJS = "CommonJS";
|
1819
|
+
type AMD = "AMD";
|
1820
|
+
type UMD = "UMD";
|
1821
|
+
type System = "System";
|
1822
|
+
type ES6 = "ES6";
|
1823
|
+
type ES2015 = "ES2015";
|
1824
|
+
}
|
1825
|
+
type ModuleKind = ModuleKind.None | ModuleKind.CommonJS | ModuleKind.AMD | ModuleKind.UMD | ModuleKind.System | ModuleKind.ES6 | ModuleKind.ES2015;
|
1826
|
+
namespace ModuleResolutionKind {
|
1827
|
+
type Classic = "Classic";
|
1828
|
+
type Node = "Node";
|
1829
|
+
}
|
1830
|
+
type ModuleResolutionKind = ModuleResolutionKind.Classic | ModuleResolutionKind.Node;
|
1831
|
+
namespace NewLineKind {
|
1832
|
+
type Crlf = "Crlf";
|
1833
|
+
type Lf = "Lf";
|
1834
|
+
}
|
1835
|
+
type NewLineKind = NewLineKind.Crlf | NewLineKind.Lf;
|
1836
|
+
namespace ScriptTarget {
|
1837
|
+
type ES3 = "ES3";
|
1838
|
+
type ES5 = "ES5";
|
1839
|
+
type ES6 = "ES6";
|
1840
|
+
type ES2015 = "ES2015";
|
1841
|
+
}
|
1842
|
+
type ScriptTarget = ScriptTarget.ES3 | ScriptTarget.ES5 | ScriptTarget.ES6 | ScriptTarget.ES2015;
|
1843
|
+
}
|
1844
|
+
declare namespace ts.server.protocol {
|
1845
|
+
|
1846
|
+
interface TextInsertion {
|
1847
|
+
newText: string;
|
1848
|
+
/** The position in newText the caret should point to after the insertion. */
|
1849
|
+
caretOffset: number;
|
1850
|
+
}
|
1851
|
+
|
1852
|
+
interface TodoCommentDescriptor {
|
1853
|
+
text: string;
|
1854
|
+
priority: number;
|
1855
|
+
}
|
1856
|
+
|
1857
|
+
interface TodoComment {
|
1858
|
+
descriptor: TodoCommentDescriptor;
|
1859
|
+
message: string;
|
1860
|
+
position: number;
|
1861
|
+
}
|
1862
|
+
|
1863
|
+
interface TypeAcquisition {
|
1864
|
+
enableAutoDiscovery?: boolean;
|
1865
|
+
enable?: boolean;
|
1866
|
+
include?: string[];
|
1867
|
+
exclude?: string[];
|
1868
|
+
[option: string]: string[] | boolean | undefined;
|
1869
|
+
}
|
1870
|
+
|
1871
|
+
interface FileExtensionInfo {
|
1872
|
+
extension: string;
|
1873
|
+
scriptKind: ScriptKind;
|
1874
|
+
isMixedContent: boolean;
|
1875
|
+
}
|
1876
|
+
|
1877
|
+
interface JSDocTagInfo {
|
1878
|
+
name: string;
|
1879
|
+
text?: string;
|
1880
|
+
}
|
1881
|
+
|
1882
|
+
interface MapLike<T> {
|
1883
|
+
[index: string]: T;
|
1884
|
+
}
|
1885
|
+
|
1886
|
+
type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]>;
|
1887
|
+
}
|
1888
|
+
declare namespace ts {
|
1889
|
+
// these types are empty stubs for types from services and should not be used directly
|
1890
|
+
export type ScriptKind = never;
|
1891
|
+
export type IndentStyle = never;
|
1892
|
+
export type JsxEmit = never;
|
1893
|
+
export type ModuleKind = never;
|
1894
|
+
export type ModuleResolutionKind = never;
|
1895
|
+
export type NewLineKind = never;
|
1896
|
+
export type ScriptTarget = never;
|
1897
|
+
}
|
1898
|
+
import protocol = ts.server.protocol;
|
1899
|
+
export = protocol;
|
1900
|
+
export as namespace protocol;
|