@lcap/nasl-types 3.9.0-beta.1
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.
- package/README.md +3 -0
- package/out/batch-query.d.ts +9 -0
- package/out/batch-query.d.ts.map +1 -0
- package/out/batch-query.js +3 -0
- package/out/batch-query.js.map +1 -0
- package/out/component.d.ts +113 -0
- package/out/component.d.ts.map +1 -0
- package/out/component.js +3 -0
- package/out/component.js.map +1 -0
- package/out/concept.d.ts +79 -0
- package/out/concept.d.ts.map +1 -0
- package/out/concept.js +3 -0
- package/out/concept.js.map +1 -0
- package/out/diagnostic.d.ts +37 -0
- package/out/diagnostic.d.ts.map +1 -0
- package/out/diagnostic.js +3 -0
- package/out/diagnostic.js.map +1 -0
- package/out/embedded.d.ts +15 -0
- package/out/embedded.d.ts.map +1 -0
- package/out/embedded.js +3 -0
- package/out/embedded.js.map +1 -0
- package/out/index.d.ts +13 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +42 -0
- package/out/index.js.map +1 -0
- package/out/logger.d.ts +8 -0
- package/out/logger.d.ts.map +1 -0
- package/out/logger.js +3 -0
- package/out/logger.js.map +1 -0
- package/out/meta.d.ts +34 -0
- package/out/meta.d.ts.map +1 -0
- package/out/meta.js +3 -0
- package/out/meta.js.map +1 -0
- package/out/module.d.ts +104 -0
- package/out/module.d.ts.map +1 -0
- package/out/module.js +3 -0
- package/out/module.js.map +1 -0
- package/out/protocol.d.ts +2980 -0
- package/out/protocol.d.ts.map +1 -0
- package/out/protocol.js +122 -0
- package/out/protocol.js.map +1 -0
- package/out/server.d.ts +24 -0
- package/out/server.d.ts.map +1 -0
- package/out/server.js +3 -0
- package/out/server.js.map +1 -0
- package/out/symbol.d.ts +144 -0
- package/out/symbol.d.ts.map +1 -0
- package/out/symbol.js +3 -0
- package/out/symbol.js.map +1 -0
- package/out/translator.d.ts +107 -0
- package/out/translator.d.ts.map +1 -0
- package/out/translator.js +3 -0
- package/out/translator.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,2980 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declaration module describing the TypeScript Server protocol
|
|
3
|
+
*/
|
|
4
|
+
declare namespace ts {
|
|
5
|
+
namespace server {
|
|
6
|
+
namespace protocol {
|
|
7
|
+
const enum CommandTypes {
|
|
8
|
+
JsxClosingTag = "jsxClosingTag",
|
|
9
|
+
Brace = "brace",
|
|
10
|
+
BraceCompletion = "braceCompletion",
|
|
11
|
+
GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
|
|
12
|
+
Change = "change",
|
|
13
|
+
Close = "close",
|
|
14
|
+
/** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
|
|
15
|
+
Completions = "completions",
|
|
16
|
+
CompletionInfo = "completionInfo",
|
|
17
|
+
CompletionDetails = "completionEntryDetails",
|
|
18
|
+
CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",
|
|
19
|
+
CompileOnSaveEmitFile = "compileOnSaveEmitFile",
|
|
20
|
+
Configure = "configure",
|
|
21
|
+
Definition = "definition",
|
|
22
|
+
DefinitionAndBoundSpan = "definitionAndBoundSpan",
|
|
23
|
+
Implementation = "implementation",
|
|
24
|
+
Exit = "exit",
|
|
25
|
+
FileReferences = "fileReferences",
|
|
26
|
+
Format = "format",
|
|
27
|
+
Formatonkey = "formatonkey",
|
|
28
|
+
Geterr = "geterr",
|
|
29
|
+
GeterrForProject = "geterrForProject",
|
|
30
|
+
SemanticDiagnosticsSync = "semanticDiagnosticsSync",
|
|
31
|
+
SyntacticDiagnosticsSync = "syntacticDiagnosticsSync",
|
|
32
|
+
SuggestionDiagnosticsSync = "suggestionDiagnosticsSync",
|
|
33
|
+
NavBar = "navbar",
|
|
34
|
+
Navto = "navto",
|
|
35
|
+
NavTree = "navtree",
|
|
36
|
+
NavTreeFull = "navtree-full",
|
|
37
|
+
/** @deprecated */
|
|
38
|
+
Occurrences = "occurrences",
|
|
39
|
+
DocumentHighlights = "documentHighlights",
|
|
40
|
+
Open = "open",
|
|
41
|
+
Quickinfo = "quickinfo",
|
|
42
|
+
References = "references",
|
|
43
|
+
Reload = "reload",
|
|
44
|
+
Rename = "rename",
|
|
45
|
+
Saveto = "saveto",
|
|
46
|
+
SignatureHelp = "signatureHelp",
|
|
47
|
+
FindSourceDefinition = "findSourceDefinition",
|
|
48
|
+
Status = "status",
|
|
49
|
+
TypeDefinition = "typeDefinition",
|
|
50
|
+
ProjectInfo = "projectInfo",
|
|
51
|
+
ReloadProjects = "reloadProjects",
|
|
52
|
+
Unknown = "unknown",
|
|
53
|
+
OpenExternalProject = "openExternalProject",
|
|
54
|
+
OpenExternalProjects = "openExternalProjects",
|
|
55
|
+
CloseExternalProject = "closeExternalProject",
|
|
56
|
+
UpdateOpen = "updateOpen",
|
|
57
|
+
GetOutliningSpans = "getOutliningSpans",
|
|
58
|
+
TodoComments = "todoComments",
|
|
59
|
+
Indentation = "indentation",
|
|
60
|
+
DocCommentTemplate = "docCommentTemplate",
|
|
61
|
+
CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
|
|
62
|
+
GetCodeFixes = "getCodeFixes",
|
|
63
|
+
GetCombinedCodeFix = "getCombinedCodeFix",
|
|
64
|
+
ApplyCodeActionCommand = "applyCodeActionCommand",
|
|
65
|
+
GetSupportedCodeFixes = "getSupportedCodeFixes",
|
|
66
|
+
GetApplicableRefactors = "getApplicableRefactors",
|
|
67
|
+
GetEditsForRefactor = "getEditsForRefactor",
|
|
68
|
+
OrganizeImports = "organizeImports",
|
|
69
|
+
GetEditsForFileRename = "getEditsForFileRename",
|
|
70
|
+
ConfigurePlugin = "configurePlugin",
|
|
71
|
+
SelectionRange = "selectionRange",
|
|
72
|
+
ToggleLineComment = "toggleLineComment",
|
|
73
|
+
ToggleMultilineComment = "toggleMultilineComment",
|
|
74
|
+
CommentSelection = "commentSelection",
|
|
75
|
+
UncommentSelection = "uncommentSelection",
|
|
76
|
+
PrepareCallHierarchy = "prepareCallHierarchy",
|
|
77
|
+
ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",
|
|
78
|
+
ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
|
|
79
|
+
ProvideInlayHints = "provideInlayHints"
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A TypeScript Server message
|
|
83
|
+
*/
|
|
84
|
+
export interface Message {
|
|
85
|
+
/**
|
|
86
|
+
* Sequence number of the message
|
|
87
|
+
*/
|
|
88
|
+
seq: number;
|
|
89
|
+
/**
|
|
90
|
+
* One of "request", "response", or "event"
|
|
91
|
+
*/
|
|
92
|
+
type: "request" | "response" | "event";
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Client-initiated request message
|
|
96
|
+
*/
|
|
97
|
+
export interface Request extends Message {
|
|
98
|
+
type: "request";
|
|
99
|
+
/**
|
|
100
|
+
* The command to execute
|
|
101
|
+
*/
|
|
102
|
+
command: string;
|
|
103
|
+
/**
|
|
104
|
+
* Object containing arguments for the command
|
|
105
|
+
*/
|
|
106
|
+
arguments?: any;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Request to reload the project structure for all the opened files
|
|
110
|
+
*/
|
|
111
|
+
export interface ReloadProjectsRequest extends Message {
|
|
112
|
+
command: CommandTypes.ReloadProjects;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Server-initiated event message
|
|
116
|
+
*/
|
|
117
|
+
export interface Event extends Message {
|
|
118
|
+
type: "event";
|
|
119
|
+
/**
|
|
120
|
+
* Name of event
|
|
121
|
+
*/
|
|
122
|
+
event: string;
|
|
123
|
+
/**
|
|
124
|
+
* Event-specific information
|
|
125
|
+
*/
|
|
126
|
+
body?: any;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Response by server to client request message.
|
|
130
|
+
*/
|
|
131
|
+
export interface Response extends Message {
|
|
132
|
+
type: "response";
|
|
133
|
+
/**
|
|
134
|
+
* Sequence number of the request message.
|
|
135
|
+
*/
|
|
136
|
+
request_seq: number;
|
|
137
|
+
/**
|
|
138
|
+
* Outcome of the request.
|
|
139
|
+
*/
|
|
140
|
+
success: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The command requested.
|
|
143
|
+
*/
|
|
144
|
+
command: string;
|
|
145
|
+
/**
|
|
146
|
+
* If success === false, this should always be provided.
|
|
147
|
+
* Otherwise, may (or may not) contain a success message.
|
|
148
|
+
*/
|
|
149
|
+
message?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Contains message body if success === true.
|
|
152
|
+
*/
|
|
153
|
+
body?: any;
|
|
154
|
+
/**
|
|
155
|
+
* Contains extra information that plugin can include to be passed on
|
|
156
|
+
*/
|
|
157
|
+
metadata?: unknown;
|
|
158
|
+
/**
|
|
159
|
+
* Exposes information about the performance of this request-response pair.
|
|
160
|
+
*/
|
|
161
|
+
performanceData?: PerformanceData;
|
|
162
|
+
}
|
|
163
|
+
export interface PerformanceData {
|
|
164
|
+
/**
|
|
165
|
+
* Time spent updating the program graph, in milliseconds.
|
|
166
|
+
*/
|
|
167
|
+
updateGraphDurationMs?: number;
|
|
168
|
+
/**
|
|
169
|
+
* The time spent creating or updating the auto-import program, in milliseconds.
|
|
170
|
+
*/
|
|
171
|
+
createAutoImportProviderProgramDurationMs?: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Arguments for FileRequest messages.
|
|
175
|
+
*/
|
|
176
|
+
export interface FileRequestArgs {
|
|
177
|
+
/**
|
|
178
|
+
* The file for the request (absolute pathname required).
|
|
179
|
+
*/
|
|
180
|
+
file: string;
|
|
181
|
+
projectFileName?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface StatusRequest extends Request {
|
|
184
|
+
command: CommandTypes.Status;
|
|
185
|
+
}
|
|
186
|
+
export interface StatusResponseBody {
|
|
187
|
+
/**
|
|
188
|
+
* The TypeScript version (`ts.version`).
|
|
189
|
+
*/
|
|
190
|
+
version: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Response to StatusRequest
|
|
194
|
+
*/
|
|
195
|
+
export interface StatusResponse extends Response {
|
|
196
|
+
body: StatusResponseBody;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Requests a JS Doc comment template for a given position
|
|
200
|
+
*/
|
|
201
|
+
export interface DocCommentTemplateRequest extends FileLocationRequest {
|
|
202
|
+
command: CommandTypes.DocCommentTemplate;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Response to DocCommentTemplateRequest
|
|
206
|
+
*/
|
|
207
|
+
export interface DocCommandTemplateResponse extends Response {
|
|
208
|
+
body?: TextInsertion;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* A request to get TODO comments from the file
|
|
212
|
+
*/
|
|
213
|
+
export interface TodoCommentRequest extends FileRequest {
|
|
214
|
+
command: CommandTypes.TodoComments;
|
|
215
|
+
arguments: TodoCommentRequestArgs;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Arguments for TodoCommentRequest request.
|
|
219
|
+
*/
|
|
220
|
+
export interface TodoCommentRequestArgs extends FileRequestArgs {
|
|
221
|
+
/**
|
|
222
|
+
* Array of target TodoCommentDescriptors that describes TODO comments to be found
|
|
223
|
+
*/
|
|
224
|
+
descriptors: TodoCommentDescriptor[];
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Response for TodoCommentRequest request.
|
|
228
|
+
*/
|
|
229
|
+
export interface TodoCommentsResponse extends Response {
|
|
230
|
+
body?: TodoComment[];
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* A request to determine if the caret is inside a comment.
|
|
234
|
+
*/
|
|
235
|
+
export interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
|
|
236
|
+
command: CommandTypes.GetSpanOfEnclosingComment;
|
|
237
|
+
arguments: SpanOfEnclosingCommentRequestArgs;
|
|
238
|
+
}
|
|
239
|
+
export interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
|
|
240
|
+
/**
|
|
241
|
+
* Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
|
|
242
|
+
*/
|
|
243
|
+
onlyMultiLine: boolean;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Request to obtain outlining spans in file.
|
|
247
|
+
*/
|
|
248
|
+
export interface OutliningSpansRequest extends FileRequest {
|
|
249
|
+
command: CommandTypes.GetOutliningSpans;
|
|
250
|
+
}
|
|
251
|
+
export interface OutliningSpan {
|
|
252
|
+
/** The span of the document to actually collapse. */
|
|
253
|
+
textSpan: TextSpan;
|
|
254
|
+
/** The span of the document to display when the user hovers over the collapsed span. */
|
|
255
|
+
hintSpan: TextSpan;
|
|
256
|
+
/** The text to display in the editor for the collapsed region. */
|
|
257
|
+
bannerText: string;
|
|
258
|
+
/**
|
|
259
|
+
* Whether or not this region should be automatically collapsed when
|
|
260
|
+
* the 'Collapse to Definitions' command is invoked.
|
|
261
|
+
*/
|
|
262
|
+
autoCollapse: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Classification of the contents of the span
|
|
265
|
+
*/
|
|
266
|
+
kind: OutliningSpanKind;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Response to OutliningSpansRequest request.
|
|
270
|
+
*/
|
|
271
|
+
export interface OutliningSpansResponse extends Response {
|
|
272
|
+
body?: OutliningSpan[];
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* A request to get indentation for a location in file
|
|
276
|
+
*/
|
|
277
|
+
export interface IndentationRequest extends FileLocationRequest {
|
|
278
|
+
command: CommandTypes.Indentation;
|
|
279
|
+
arguments: IndentationRequestArgs;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Response for IndentationRequest request.
|
|
283
|
+
*/
|
|
284
|
+
export interface IndentationResponse extends Response {
|
|
285
|
+
body?: IndentationResult;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Indentation result representing where indentation should be placed
|
|
289
|
+
*/
|
|
290
|
+
export interface IndentationResult {
|
|
291
|
+
/**
|
|
292
|
+
* The base position in the document that the indent should be relative to
|
|
293
|
+
*/
|
|
294
|
+
position: number;
|
|
295
|
+
/**
|
|
296
|
+
* The number of columns the indent should be at relative to the position's column.
|
|
297
|
+
*/
|
|
298
|
+
indentation: number;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Arguments for IndentationRequest request.
|
|
302
|
+
*/
|
|
303
|
+
export interface IndentationRequestArgs extends FileLocationRequestArgs {
|
|
304
|
+
/**
|
|
305
|
+
* An optional set of settings to be used when computing indentation.
|
|
306
|
+
* If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
|
|
307
|
+
*/
|
|
308
|
+
options?: EditorSettings;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Arguments for ProjectInfoRequest request.
|
|
312
|
+
*/
|
|
313
|
+
export interface ProjectInfoRequestArgs extends FileRequestArgs {
|
|
314
|
+
/**
|
|
315
|
+
* Indicate if the file name list of the project is needed
|
|
316
|
+
*/
|
|
317
|
+
needFileNameList: boolean;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* A request to get the project information of the current file.
|
|
321
|
+
*/
|
|
322
|
+
export interface ProjectInfoRequest extends Request {
|
|
323
|
+
command: CommandTypes.ProjectInfo;
|
|
324
|
+
arguments: ProjectInfoRequestArgs;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* A request to retrieve compiler options diagnostics for a project
|
|
328
|
+
*/
|
|
329
|
+
export interface CompilerOptionsDiagnosticsRequest extends Request {
|
|
330
|
+
arguments: CompilerOptionsDiagnosticsRequestArgs;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Arguments for CompilerOptionsDiagnosticsRequest request.
|
|
334
|
+
*/
|
|
335
|
+
export interface CompilerOptionsDiagnosticsRequestArgs {
|
|
336
|
+
/**
|
|
337
|
+
* Name of the project to retrieve compiler options diagnostics.
|
|
338
|
+
*/
|
|
339
|
+
projectFileName: string;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Response message body for "projectInfo" request
|
|
343
|
+
*/
|
|
344
|
+
export interface ProjectInfo {
|
|
345
|
+
/**
|
|
346
|
+
* For configured project, this is the normalized path of the 'tsconfig.json' file
|
|
347
|
+
* For inferred project, this is undefined
|
|
348
|
+
*/
|
|
349
|
+
configFileName: string;
|
|
350
|
+
/**
|
|
351
|
+
* The list of normalized file name in the project, including 'lib.d.ts'
|
|
352
|
+
*/
|
|
353
|
+
fileNames?: string[];
|
|
354
|
+
/**
|
|
355
|
+
* Indicates if the project has a active language service instance
|
|
356
|
+
*/
|
|
357
|
+
languageServiceDisabled?: boolean;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Represents diagnostic info that includes location of diagnostic in two forms
|
|
361
|
+
* - start position and length of the error span
|
|
362
|
+
* - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
|
|
363
|
+
*/
|
|
364
|
+
export interface DiagnosticWithLinePosition {
|
|
365
|
+
message: string;
|
|
366
|
+
start: number;
|
|
367
|
+
length: number;
|
|
368
|
+
startLocation: Location;
|
|
369
|
+
endLocation: Location;
|
|
370
|
+
category: string;
|
|
371
|
+
code: number;
|
|
372
|
+
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
|
|
373
|
+
reportsUnnecessary?: {};
|
|
374
|
+
reportsDeprecated?: {};
|
|
375
|
+
relatedInformation?: DiagnosticRelatedInformation[];
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Response message for "projectInfo" request
|
|
379
|
+
*/
|
|
380
|
+
export interface ProjectInfoResponse extends Response {
|
|
381
|
+
body?: ProjectInfo;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Request whose sole parameter is a file name.
|
|
385
|
+
*/
|
|
386
|
+
export interface FileRequest extends Request {
|
|
387
|
+
arguments: FileRequestArgs;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Instances of this interface specify a location in a source file:
|
|
391
|
+
* (file, line, character offset), where line and character offset are 1-based.
|
|
392
|
+
*/
|
|
393
|
+
export interface FileLocationRequestArgs extends FileRequestArgs {
|
|
394
|
+
/**
|
|
395
|
+
* The line number for the request (1-based).
|
|
396
|
+
*/
|
|
397
|
+
line: number;
|
|
398
|
+
/**
|
|
399
|
+
* The character offset (on the line) for the request (1-based).
|
|
400
|
+
*/
|
|
401
|
+
offset: number;
|
|
402
|
+
}
|
|
403
|
+
type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
|
|
404
|
+
/**
|
|
405
|
+
* Request refactorings at a given position or selection area.
|
|
406
|
+
*/
|
|
407
|
+
export interface GetApplicableRefactorsRequest extends Request {
|
|
408
|
+
command: CommandTypes.GetApplicableRefactors;
|
|
409
|
+
arguments: GetApplicableRefactorsRequestArgs;
|
|
410
|
+
}
|
|
411
|
+
type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
|
|
412
|
+
triggerReason?: RefactorTriggerReason;
|
|
413
|
+
kind?: string;
|
|
414
|
+
};
|
|
415
|
+
type RefactorTriggerReason = "implicit" | "invoked";
|
|
416
|
+
/**
|
|
417
|
+
* Response is a list of available refactorings.
|
|
418
|
+
* Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
|
|
419
|
+
*/
|
|
420
|
+
export interface GetApplicableRefactorsResponse extends Response {
|
|
421
|
+
body?: ApplicableRefactorInfo[];
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* A set of one or more available refactoring actions, grouped under a parent refactoring.
|
|
425
|
+
*/
|
|
426
|
+
export interface ApplicableRefactorInfo {
|
|
427
|
+
/**
|
|
428
|
+
* The programmatic name of the refactoring
|
|
429
|
+
*/
|
|
430
|
+
name: string;
|
|
431
|
+
/**
|
|
432
|
+
* A description of this refactoring category to show to the user.
|
|
433
|
+
* If the refactoring gets inlined (see below), this text will not be visible.
|
|
434
|
+
*/
|
|
435
|
+
description: string;
|
|
436
|
+
/**
|
|
437
|
+
* Inlineable refactorings can have their actions hoisted out to the top level
|
|
438
|
+
* of a context menu. Non-inlineanable refactorings should always be shown inside
|
|
439
|
+
* their parent grouping.
|
|
440
|
+
*
|
|
441
|
+
* If not specified, this value is assumed to be 'true'
|
|
442
|
+
*/
|
|
443
|
+
inlineable?: boolean;
|
|
444
|
+
actions: RefactorActionInfo[];
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Represents a single refactoring action - for example, the "Extract Method..." refactor might
|
|
448
|
+
* offer several actions, each corresponding to a surround class or closure to extract into.
|
|
449
|
+
*/
|
|
450
|
+
export interface RefactorActionInfo {
|
|
451
|
+
/**
|
|
452
|
+
* The programmatic name of the refactoring action
|
|
453
|
+
*/
|
|
454
|
+
name: string;
|
|
455
|
+
/**
|
|
456
|
+
* A description of this refactoring action to show to the user.
|
|
457
|
+
* If the parent refactoring is inlined away, this will be the only text shown,
|
|
458
|
+
* so this description should make sense by itself if the parent is inlineable=true
|
|
459
|
+
*/
|
|
460
|
+
description: string;
|
|
461
|
+
/**
|
|
462
|
+
* A message to show to the user if the refactoring cannot be applied in
|
|
463
|
+
* the current context.
|
|
464
|
+
*/
|
|
465
|
+
notApplicableReason?: string;
|
|
466
|
+
/**
|
|
467
|
+
* The hierarchical dotted name of the refactor action.
|
|
468
|
+
*/
|
|
469
|
+
kind?: string;
|
|
470
|
+
}
|
|
471
|
+
export interface GetEditsForRefactorRequest extends Request {
|
|
472
|
+
command: CommandTypes.GetEditsForRefactor;
|
|
473
|
+
arguments: GetEditsForRefactorRequestArgs;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Request the edits that a particular refactoring action produces.
|
|
477
|
+
* Callers must specify the name of the refactor and the name of the action.
|
|
478
|
+
*/
|
|
479
|
+
type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
|
|
480
|
+
refactor: string;
|
|
481
|
+
action: string;
|
|
482
|
+
};
|
|
483
|
+
export interface GetEditsForRefactorResponse extends Response {
|
|
484
|
+
body?: RefactorEditInfo;
|
|
485
|
+
}
|
|
486
|
+
export interface RefactorEditInfo {
|
|
487
|
+
edits: FileCodeEdits[];
|
|
488
|
+
/**
|
|
489
|
+
* An optional location where the editor should start a rename operation once
|
|
490
|
+
* the refactoring edits have been applied
|
|
491
|
+
*/
|
|
492
|
+
renameLocation?: Location;
|
|
493
|
+
renameFilename?: string;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Organize imports by:
|
|
497
|
+
* 1) Removing unused imports
|
|
498
|
+
* 2) Coalescing imports from the same module
|
|
499
|
+
* 3) Sorting imports
|
|
500
|
+
*/
|
|
501
|
+
export interface OrganizeImportsRequest extends Request {
|
|
502
|
+
command: CommandTypes.OrganizeImports;
|
|
503
|
+
arguments: OrganizeImportsRequestArgs;
|
|
504
|
+
}
|
|
505
|
+
type OrganizeImportsScope = GetCombinedCodeFixScope;
|
|
506
|
+
export interface OrganizeImportsRequestArgs {
|
|
507
|
+
scope: OrganizeImportsScope;
|
|
508
|
+
skipDestructiveCodeActions?: boolean;
|
|
509
|
+
}
|
|
510
|
+
export interface OrganizeImportsResponse extends Response {
|
|
511
|
+
body: readonly FileCodeEdits[];
|
|
512
|
+
}
|
|
513
|
+
export interface GetEditsForFileRenameRequest extends Request {
|
|
514
|
+
command: CommandTypes.GetEditsForFileRename;
|
|
515
|
+
arguments: GetEditsForFileRenameRequestArgs;
|
|
516
|
+
}
|
|
517
|
+
/** Note: Paths may also be directories. */
|
|
518
|
+
export interface GetEditsForFileRenameRequestArgs {
|
|
519
|
+
readonly oldFilePath: string;
|
|
520
|
+
readonly newFilePath: string;
|
|
521
|
+
}
|
|
522
|
+
export interface GetEditsForFileRenameResponse extends Response {
|
|
523
|
+
body: readonly FileCodeEdits[];
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Request for the available codefixes at a specific position.
|
|
527
|
+
*/
|
|
528
|
+
export interface CodeFixRequest extends Request {
|
|
529
|
+
command: CommandTypes.GetCodeFixes;
|
|
530
|
+
arguments: CodeFixRequestArgs;
|
|
531
|
+
}
|
|
532
|
+
export interface GetCombinedCodeFixRequest extends Request {
|
|
533
|
+
command: CommandTypes.GetCombinedCodeFix;
|
|
534
|
+
arguments: GetCombinedCodeFixRequestArgs;
|
|
535
|
+
}
|
|
536
|
+
export interface GetCombinedCodeFixResponse extends Response {
|
|
537
|
+
body: CombinedCodeActions;
|
|
538
|
+
}
|
|
539
|
+
export interface ApplyCodeActionCommandRequest extends Request {
|
|
540
|
+
command: CommandTypes.ApplyCodeActionCommand;
|
|
541
|
+
arguments: ApplyCodeActionCommandRequestArgs;
|
|
542
|
+
}
|
|
543
|
+
export interface ApplyCodeActionCommandResponse extends Response {
|
|
544
|
+
}
|
|
545
|
+
export interface FileRangeRequestArgs extends FileRequestArgs {
|
|
546
|
+
/**
|
|
547
|
+
* The line number for the request (1-based).
|
|
548
|
+
*/
|
|
549
|
+
startLine: number;
|
|
550
|
+
/**
|
|
551
|
+
* The character offset (on the line) for the request (1-based).
|
|
552
|
+
*/
|
|
553
|
+
startOffset: number;
|
|
554
|
+
/**
|
|
555
|
+
* The line number for the request (1-based).
|
|
556
|
+
*/
|
|
557
|
+
endLine: number;
|
|
558
|
+
/**
|
|
559
|
+
* The character offset (on the line) for the request (1-based).
|
|
560
|
+
*/
|
|
561
|
+
endOffset: number;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Instances of this interface specify errorcodes on a specific location in a sourcefile.
|
|
565
|
+
*/
|
|
566
|
+
export interface CodeFixRequestArgs extends FileRangeRequestArgs {
|
|
567
|
+
/**
|
|
568
|
+
* Errorcodes we want to get the fixes for.
|
|
569
|
+
*/
|
|
570
|
+
errorCodes: readonly number[];
|
|
571
|
+
}
|
|
572
|
+
export interface GetCombinedCodeFixRequestArgs {
|
|
573
|
+
scope: GetCombinedCodeFixScope;
|
|
574
|
+
fixId: {};
|
|
575
|
+
}
|
|
576
|
+
export interface GetCombinedCodeFixScope {
|
|
577
|
+
type: "file";
|
|
578
|
+
args: FileRequestArgs;
|
|
579
|
+
}
|
|
580
|
+
export interface ApplyCodeActionCommandRequestArgs {
|
|
581
|
+
/** May also be an array of commands. */
|
|
582
|
+
command: {};
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Response for GetCodeFixes request.
|
|
586
|
+
*/
|
|
587
|
+
export interface GetCodeFixesResponse extends Response {
|
|
588
|
+
body?: CodeAction[];
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* A request whose arguments specify a file location (file, line, col).
|
|
592
|
+
*/
|
|
593
|
+
export interface FileLocationRequest extends FileRequest {
|
|
594
|
+
arguments: FileLocationRequestArgs;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* A request to get codes of supported code fixes.
|
|
598
|
+
*/
|
|
599
|
+
export interface GetSupportedCodeFixesRequest extends Request {
|
|
600
|
+
command: CommandTypes.GetSupportedCodeFixes;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* A response for GetSupportedCodeFixesRequest request.
|
|
604
|
+
*/
|
|
605
|
+
export interface GetSupportedCodeFixesResponse extends Response {
|
|
606
|
+
/**
|
|
607
|
+
* List of error codes supported by the server.
|
|
608
|
+
*/
|
|
609
|
+
body?: string[];
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* A request to get encoded semantic classifications for a span in the file
|
|
613
|
+
*/
|
|
614
|
+
export interface EncodedSemanticClassificationsRequest extends FileRequest {
|
|
615
|
+
arguments: EncodedSemanticClassificationsRequestArgs;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Arguments for EncodedSemanticClassificationsRequest request.
|
|
619
|
+
*/
|
|
620
|
+
export interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
|
|
621
|
+
/**
|
|
622
|
+
* Start position of the span.
|
|
623
|
+
*/
|
|
624
|
+
start: number;
|
|
625
|
+
/**
|
|
626
|
+
* Length of the span.
|
|
627
|
+
*/
|
|
628
|
+
length: number;
|
|
629
|
+
/**
|
|
630
|
+
* Optional parameter for the semantic highlighting response, if absent it
|
|
631
|
+
* defaults to "original".
|
|
632
|
+
*/
|
|
633
|
+
format?: "original" | "2020";
|
|
634
|
+
}
|
|
635
|
+
/** The response for a EncodedSemanticClassificationsRequest */
|
|
636
|
+
export interface EncodedSemanticClassificationsResponse extends Response {
|
|
637
|
+
body?: EncodedSemanticClassificationsResponseBody;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Implementation response message. Gives series of text spans depending on the format ar.
|
|
641
|
+
*/
|
|
642
|
+
export interface EncodedSemanticClassificationsResponseBody {
|
|
643
|
+
endOfLineState: EndOfLineState;
|
|
644
|
+
spans: number[];
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Arguments in document highlight request; include: filesToSearch, file,
|
|
648
|
+
* line, offset.
|
|
649
|
+
*/
|
|
650
|
+
export interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
|
|
651
|
+
/**
|
|
652
|
+
* List of files to search for document highlights.
|
|
653
|
+
*/
|
|
654
|
+
filesToSearch: string[];
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Go to definition request; value of command field is
|
|
658
|
+
* "definition". Return response giving the file locations that
|
|
659
|
+
* define the symbol found in file at location line, col.
|
|
660
|
+
*/
|
|
661
|
+
export interface DefinitionRequest extends FileLocationRequest {
|
|
662
|
+
command: CommandTypes.Definition;
|
|
663
|
+
}
|
|
664
|
+
export interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
|
|
665
|
+
readonly command: CommandTypes.DefinitionAndBoundSpan;
|
|
666
|
+
}
|
|
667
|
+
export interface FindSourceDefinitionRequest extends FileLocationRequest {
|
|
668
|
+
readonly command: CommandTypes.FindSourceDefinition;
|
|
669
|
+
}
|
|
670
|
+
export interface DefinitionAndBoundSpanResponse extends Response {
|
|
671
|
+
readonly body: DefinitionInfoAndBoundSpan;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Go to type request; value of command field is
|
|
675
|
+
* "typeDefinition". Return response giving the file locations that
|
|
676
|
+
* define the type for the symbol found in file at location line, col.
|
|
677
|
+
*/
|
|
678
|
+
export interface TypeDefinitionRequest extends FileLocationRequest {
|
|
679
|
+
command: CommandTypes.TypeDefinition;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Go to implementation request; value of command field is
|
|
683
|
+
* "implementation". Return response giving the file locations that
|
|
684
|
+
* implement the symbol found in file at location line, col.
|
|
685
|
+
*/
|
|
686
|
+
export interface ImplementationRequest extends FileLocationRequest {
|
|
687
|
+
command: CommandTypes.Implementation;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Location in source code expressed as (one-based) line and (one-based) column offset.
|
|
691
|
+
*/
|
|
692
|
+
export interface Location {
|
|
693
|
+
line: number;
|
|
694
|
+
offset: number;
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Object found in response messages defining a span of text in source code.
|
|
698
|
+
*/
|
|
699
|
+
export interface TextSpan {
|
|
700
|
+
/**
|
|
701
|
+
* First character of the definition.
|
|
702
|
+
*/
|
|
703
|
+
start: Location;
|
|
704
|
+
/**
|
|
705
|
+
* One character past last character of the definition.
|
|
706
|
+
*/
|
|
707
|
+
end: Location;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Object found in response messages defining a span of text in a specific source file.
|
|
711
|
+
*/
|
|
712
|
+
export interface FileSpan extends TextSpan {
|
|
713
|
+
/**
|
|
714
|
+
* File containing text span.
|
|
715
|
+
*/
|
|
716
|
+
file: string;
|
|
717
|
+
}
|
|
718
|
+
export interface JSDocTagInfo {
|
|
719
|
+
/** Name of the JSDoc tag */
|
|
720
|
+
name: string;
|
|
721
|
+
/**
|
|
722
|
+
* Comment text after the JSDoc tag -- the text after the tag name until the next tag or end of comment
|
|
723
|
+
* Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
|
|
724
|
+
*/
|
|
725
|
+
text?: string | SymbolDisplayPart[];
|
|
726
|
+
}
|
|
727
|
+
export interface TextSpanWithContext extends TextSpan {
|
|
728
|
+
contextStart?: Location;
|
|
729
|
+
contextEnd?: Location;
|
|
730
|
+
}
|
|
731
|
+
export interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
|
|
732
|
+
}
|
|
733
|
+
export interface DefinitionInfo extends FileSpanWithContext {
|
|
734
|
+
/**
|
|
735
|
+
* When true, the file may or may not exist.
|
|
736
|
+
*/
|
|
737
|
+
unverified?: boolean;
|
|
738
|
+
}
|
|
739
|
+
export interface DefinitionInfoAndBoundSpan {
|
|
740
|
+
definitions: readonly DefinitionInfo[];
|
|
741
|
+
textSpan: TextSpan;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Definition response message. Gives text range for definition.
|
|
745
|
+
*/
|
|
746
|
+
export interface DefinitionResponse extends Response {
|
|
747
|
+
body?: DefinitionInfo[];
|
|
748
|
+
}
|
|
749
|
+
export interface DefinitionInfoAndBoundSpanResponse extends Response {
|
|
750
|
+
body?: DefinitionInfoAndBoundSpan;
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Definition response message. Gives text range for definition.
|
|
754
|
+
*/
|
|
755
|
+
export interface TypeDefinitionResponse extends Response {
|
|
756
|
+
body?: FileSpanWithContext[];
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Implementation response message. Gives text range for implementations.
|
|
760
|
+
*/
|
|
761
|
+
export interface ImplementationResponse extends Response {
|
|
762
|
+
body?: FileSpanWithContext[];
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Request to get brace completion for a location in the file.
|
|
766
|
+
*/
|
|
767
|
+
export interface BraceCompletionRequest extends FileLocationRequest {
|
|
768
|
+
command: CommandTypes.BraceCompletion;
|
|
769
|
+
arguments: BraceCompletionRequestArgs;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Argument for BraceCompletionRequest request.
|
|
773
|
+
*/
|
|
774
|
+
export interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
|
|
775
|
+
/**
|
|
776
|
+
* Kind of opening brace
|
|
777
|
+
*/
|
|
778
|
+
openingBrace: string;
|
|
779
|
+
}
|
|
780
|
+
export interface JsxClosingTagRequest extends FileLocationRequest {
|
|
781
|
+
readonly command: CommandTypes.JsxClosingTag;
|
|
782
|
+
readonly arguments: JsxClosingTagRequestArgs;
|
|
783
|
+
}
|
|
784
|
+
export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
|
|
785
|
+
}
|
|
786
|
+
export interface JsxClosingTagResponse extends Response {
|
|
787
|
+
readonly body: TextInsertion;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* @deprecated
|
|
791
|
+
* Get occurrences request; value of command field is
|
|
792
|
+
* "occurrences". Return response giving spans that are relevant
|
|
793
|
+
* in the file at a given line and column.
|
|
794
|
+
*/
|
|
795
|
+
export interface OccurrencesRequest extends FileLocationRequest {
|
|
796
|
+
command: CommandTypes.Occurrences;
|
|
797
|
+
}
|
|
798
|
+
/** @deprecated */
|
|
799
|
+
export interface OccurrencesResponseItem extends FileSpanWithContext {
|
|
800
|
+
/**
|
|
801
|
+
* True if the occurrence is a write location, false otherwise.
|
|
802
|
+
*/
|
|
803
|
+
isWriteAccess: boolean;
|
|
804
|
+
/**
|
|
805
|
+
* True if the occurrence is in a string, undefined otherwise;
|
|
806
|
+
*/
|
|
807
|
+
isInString?: true;
|
|
808
|
+
}
|
|
809
|
+
/** @deprecated */
|
|
810
|
+
export interface OccurrencesResponse extends Response {
|
|
811
|
+
body?: OccurrencesResponseItem[];
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Get document highlights request; value of command field is
|
|
815
|
+
* "documentHighlights". Return response giving spans that are relevant
|
|
816
|
+
* in the file at a given line and column.
|
|
817
|
+
*/
|
|
818
|
+
export interface DocumentHighlightsRequest extends FileLocationRequest {
|
|
819
|
+
command: CommandTypes.DocumentHighlights;
|
|
820
|
+
arguments: DocumentHighlightsRequestArgs;
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Span augmented with extra information that denotes the kind of the highlighting to be used for span.
|
|
824
|
+
*/
|
|
825
|
+
export interface HighlightSpan extends TextSpanWithContext {
|
|
826
|
+
kind: HighlightSpanKind;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Represents a set of highligh spans for a give name
|
|
830
|
+
*/
|
|
831
|
+
export interface DocumentHighlightsItem {
|
|
832
|
+
/**
|
|
833
|
+
* File containing highlight spans.
|
|
834
|
+
*/
|
|
835
|
+
file: string;
|
|
836
|
+
/**
|
|
837
|
+
* Spans to highlight in file.
|
|
838
|
+
*/
|
|
839
|
+
highlightSpans: HighlightSpan[];
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Response for a DocumentHighlightsRequest request.
|
|
843
|
+
*/
|
|
844
|
+
export interface DocumentHighlightsResponse extends Response {
|
|
845
|
+
body?: DocumentHighlightsItem[];
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Find references request; value of command field is
|
|
849
|
+
* "references". Return response giving the file locations that
|
|
850
|
+
* reference the symbol found in file at location line, col.
|
|
851
|
+
*/
|
|
852
|
+
export interface ReferencesRequest extends FileLocationRequest {
|
|
853
|
+
command: CommandTypes.References;
|
|
854
|
+
}
|
|
855
|
+
export interface ReferencesResponseItem extends FileSpanWithContext {
|
|
856
|
+
/** Text of line containing the reference. Including this
|
|
857
|
+
* with the response avoids latency of editor loading files
|
|
858
|
+
* to show text of reference line (the server already has
|
|
859
|
+
* loaded the referencing files).
|
|
860
|
+
*/
|
|
861
|
+
lineText: string;
|
|
862
|
+
/**
|
|
863
|
+
* True if reference is a write location, false otherwise.
|
|
864
|
+
*/
|
|
865
|
+
isWriteAccess: boolean;
|
|
866
|
+
/**
|
|
867
|
+
* Present only if the search was triggered from a declaration.
|
|
868
|
+
* True indicates that the references refers to the same symbol
|
|
869
|
+
* (i.e. has the same meaning) as the declaration that began the
|
|
870
|
+
* search.
|
|
871
|
+
*/
|
|
872
|
+
isDefinition?: boolean;
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* The body of a "references" response message.
|
|
876
|
+
*/
|
|
877
|
+
export interface ReferencesResponseBody {
|
|
878
|
+
/**
|
|
879
|
+
* The file locations referencing the symbol.
|
|
880
|
+
*/
|
|
881
|
+
refs: readonly ReferencesResponseItem[];
|
|
882
|
+
/**
|
|
883
|
+
* The name of the symbol.
|
|
884
|
+
*/
|
|
885
|
+
symbolName: string;
|
|
886
|
+
/**
|
|
887
|
+
* The start character offset of the symbol (on the line provided by the references request).
|
|
888
|
+
*/
|
|
889
|
+
symbolStartOffset: number;
|
|
890
|
+
/**
|
|
891
|
+
* The full display name of the symbol.
|
|
892
|
+
*/
|
|
893
|
+
symbolDisplayString: string;
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Response to "references" request.
|
|
897
|
+
*/
|
|
898
|
+
export interface ReferencesResponse extends Response {
|
|
899
|
+
body?: ReferencesResponseBody;
|
|
900
|
+
}
|
|
901
|
+
export interface FileReferencesRequest extends FileRequest {
|
|
902
|
+
command: CommandTypes.FileReferences;
|
|
903
|
+
}
|
|
904
|
+
export interface FileReferencesResponseBody {
|
|
905
|
+
/**
|
|
906
|
+
* The file locations referencing the symbol.
|
|
907
|
+
*/
|
|
908
|
+
refs: readonly ReferencesResponseItem[];
|
|
909
|
+
/**
|
|
910
|
+
* The name of the symbol.
|
|
911
|
+
*/
|
|
912
|
+
symbolName: string;
|
|
913
|
+
}
|
|
914
|
+
export interface FileReferencesResponse extends Response {
|
|
915
|
+
body?: FileReferencesResponseBody;
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Argument for RenameRequest request.
|
|
919
|
+
*/
|
|
920
|
+
export interface RenameRequestArgs extends FileLocationRequestArgs {
|
|
921
|
+
/**
|
|
922
|
+
* Should text at specified location be found/changed in comments?
|
|
923
|
+
*/
|
|
924
|
+
findInComments?: boolean;
|
|
925
|
+
/**
|
|
926
|
+
* Should text at specified location be found/changed in strings?
|
|
927
|
+
*/
|
|
928
|
+
findInStrings?: boolean;
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* Rename request; value of command field is "rename". Return
|
|
932
|
+
* response giving the file locations that reference the symbol
|
|
933
|
+
* found in file at location line, col. Also return full display
|
|
934
|
+
* name of the symbol so that client can print it unambiguously.
|
|
935
|
+
*/
|
|
936
|
+
export interface RenameRequest extends FileLocationRequest {
|
|
937
|
+
command: CommandTypes.Rename;
|
|
938
|
+
arguments: RenameRequestArgs;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Information about the item to be renamed.
|
|
942
|
+
*/
|
|
943
|
+
type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
|
|
944
|
+
export interface RenameInfoSuccess {
|
|
945
|
+
/**
|
|
946
|
+
* True if item can be renamed.
|
|
947
|
+
*/
|
|
948
|
+
canRename: true;
|
|
949
|
+
/**
|
|
950
|
+
* File or directory to rename.
|
|
951
|
+
* If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
|
|
952
|
+
*/
|
|
953
|
+
fileToRename?: string;
|
|
954
|
+
/**
|
|
955
|
+
* Display name of the item to be renamed.
|
|
956
|
+
*/
|
|
957
|
+
displayName: string;
|
|
958
|
+
/**
|
|
959
|
+
* Full display name of item to be renamed.
|
|
960
|
+
*/
|
|
961
|
+
fullDisplayName: string;
|
|
962
|
+
/**
|
|
963
|
+
* The items's kind (such as 'className' or 'parameterName' or plain 'text').
|
|
964
|
+
*/
|
|
965
|
+
kind: ScriptElementKind;
|
|
966
|
+
/**
|
|
967
|
+
* Optional modifiers for the kind (such as 'public').
|
|
968
|
+
*/
|
|
969
|
+
kindModifiers: string;
|
|
970
|
+
/** Span of text to rename. */
|
|
971
|
+
triggerSpan: TextSpan;
|
|
972
|
+
}
|
|
973
|
+
export interface RenameInfoFailure {
|
|
974
|
+
canRename: false;
|
|
975
|
+
/**
|
|
976
|
+
* Error message if item can not be renamed.
|
|
977
|
+
*/
|
|
978
|
+
localizedErrorMessage: string;
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* A group of text spans, all in 'file'.
|
|
982
|
+
*/
|
|
983
|
+
export interface SpanGroup {
|
|
984
|
+
/** The file to which the spans apply */
|
|
985
|
+
file: string;
|
|
986
|
+
/** The text spans in this group */
|
|
987
|
+
locs: RenameTextSpan[];
|
|
988
|
+
}
|
|
989
|
+
export interface RenameTextSpan extends TextSpanWithContext {
|
|
990
|
+
readonly prefixText?: string;
|
|
991
|
+
readonly suffixText?: string;
|
|
992
|
+
}
|
|
993
|
+
export interface RenameResponseBody {
|
|
994
|
+
/**
|
|
995
|
+
* Information about the item to be renamed.
|
|
996
|
+
*/
|
|
997
|
+
info: RenameInfo;
|
|
998
|
+
/**
|
|
999
|
+
* An array of span groups (one per file) that refer to the item to be renamed.
|
|
1000
|
+
*/
|
|
1001
|
+
locs: readonly SpanGroup[];
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Rename response message.
|
|
1005
|
+
*/
|
|
1006
|
+
export interface RenameResponse extends Response {
|
|
1007
|
+
body?: RenameResponseBody;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Represents a file in external project.
|
|
1011
|
+
* External project is project whose set of files, compilation options and open\close state
|
|
1012
|
+
* is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
|
|
1013
|
+
* External project will exist even if all files in it are closed and should be closed explicitly.
|
|
1014
|
+
* If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
|
|
1015
|
+
* create configured project for every config file but will maintain a link that these projects were created
|
|
1016
|
+
* as a result of opening external project so they should be removed once external project is closed.
|
|
1017
|
+
*/
|
|
1018
|
+
export interface ExternalFile {
|
|
1019
|
+
/**
|
|
1020
|
+
* Name of file file
|
|
1021
|
+
*/
|
|
1022
|
+
fileName: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* Script kind of the file
|
|
1025
|
+
*/
|
|
1026
|
+
scriptKind?: ScriptKindName | ts.ScriptKind;
|
|
1027
|
+
/**
|
|
1028
|
+
* Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)
|
|
1029
|
+
*/
|
|
1030
|
+
hasMixedContent?: boolean;
|
|
1031
|
+
/**
|
|
1032
|
+
* Content of the file
|
|
1033
|
+
*/
|
|
1034
|
+
content?: string;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Represent an external project
|
|
1038
|
+
*/
|
|
1039
|
+
export interface ExternalProject {
|
|
1040
|
+
/**
|
|
1041
|
+
* Project name
|
|
1042
|
+
*/
|
|
1043
|
+
projectFileName: string;
|
|
1044
|
+
/**
|
|
1045
|
+
* List of root files in project
|
|
1046
|
+
*/
|
|
1047
|
+
rootFiles: ExternalFile[];
|
|
1048
|
+
/**
|
|
1049
|
+
* Compiler options for the project
|
|
1050
|
+
*/
|
|
1051
|
+
options: ExternalProjectCompilerOptions;
|
|
1052
|
+
/**
|
|
1053
|
+
* @deprecated typingOptions. Use typeAcquisition instead
|
|
1054
|
+
*/
|
|
1055
|
+
typingOptions?: TypeAcquisition;
|
|
1056
|
+
/**
|
|
1057
|
+
* Explicitly specified type acquisition for the project
|
|
1058
|
+
*/
|
|
1059
|
+
typeAcquisition?: TypeAcquisition;
|
|
1060
|
+
}
|
|
1061
|
+
export interface CompileOnSaveMixin {
|
|
1062
|
+
/**
|
|
1063
|
+
* If compile on save is enabled for the project
|
|
1064
|
+
*/
|
|
1065
|
+
compileOnSave?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* For external projects, some of the project settings are sent together with
|
|
1069
|
+
* compiler settings.
|
|
1070
|
+
*/
|
|
1071
|
+
type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
|
|
1072
|
+
export interface FileWithProjectReferenceRedirectInfo {
|
|
1073
|
+
/**
|
|
1074
|
+
* Name of file
|
|
1075
|
+
*/
|
|
1076
|
+
fileName: string;
|
|
1077
|
+
/**
|
|
1078
|
+
* True if the file is primarily included in a referenced project
|
|
1079
|
+
*/
|
|
1080
|
+
isSourceOfProjectReferenceRedirect: boolean;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Represents a set of changes that happen in project
|
|
1084
|
+
*/
|
|
1085
|
+
export interface ProjectChanges {
|
|
1086
|
+
/**
|
|
1087
|
+
* List of added files
|
|
1088
|
+
*/
|
|
1089
|
+
added: string[] | FileWithProjectReferenceRedirectInfo[];
|
|
1090
|
+
/**
|
|
1091
|
+
* List of removed files
|
|
1092
|
+
*/
|
|
1093
|
+
removed: string[] | FileWithProjectReferenceRedirectInfo[];
|
|
1094
|
+
/**
|
|
1095
|
+
* List of updated files
|
|
1096
|
+
*/
|
|
1097
|
+
updated: string[] | FileWithProjectReferenceRedirectInfo[];
|
|
1098
|
+
/**
|
|
1099
|
+
* List of files that have had their project reference redirect status updated
|
|
1100
|
+
* Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true
|
|
1101
|
+
*/
|
|
1102
|
+
updatedRedirects?: FileWithProjectReferenceRedirectInfo[];
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Information found in a configure request.
|
|
1106
|
+
*/
|
|
1107
|
+
export interface ConfigureRequestArguments {
|
|
1108
|
+
/**
|
|
1109
|
+
* Information about the host, for example 'Emacs 24.4' or
|
|
1110
|
+
* 'Sublime Text version 3075'
|
|
1111
|
+
*/
|
|
1112
|
+
hostInfo?: string;
|
|
1113
|
+
/**
|
|
1114
|
+
* If present, tab settings apply only to this file.
|
|
1115
|
+
*/
|
|
1116
|
+
file?: string;
|
|
1117
|
+
/**
|
|
1118
|
+
* The format options to use during formatting and other code editing features.
|
|
1119
|
+
*/
|
|
1120
|
+
formatOptions?: FormatCodeSettings;
|
|
1121
|
+
preferences?: UserPreferences;
|
|
1122
|
+
/**
|
|
1123
|
+
* The host's additional supported .js file extensions
|
|
1124
|
+
*/
|
|
1125
|
+
extraFileExtensions?: FileExtensionInfo[];
|
|
1126
|
+
watchOptions?: WatchOptions;
|
|
1127
|
+
}
|
|
1128
|
+
const enum WatchFileKind {
|
|
1129
|
+
FixedPollingInterval = "FixedPollingInterval",
|
|
1130
|
+
PriorityPollingInterval = "PriorityPollingInterval",
|
|
1131
|
+
DynamicPriorityPolling = "DynamicPriorityPolling",
|
|
1132
|
+
FixedChunkSizePolling = "FixedChunkSizePolling",
|
|
1133
|
+
UseFsEvents = "UseFsEvents",
|
|
1134
|
+
UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory"
|
|
1135
|
+
}
|
|
1136
|
+
const enum WatchDirectoryKind {
|
|
1137
|
+
UseFsEvents = "UseFsEvents",
|
|
1138
|
+
FixedPollingInterval = "FixedPollingInterval",
|
|
1139
|
+
DynamicPriorityPolling = "DynamicPriorityPolling",
|
|
1140
|
+
FixedChunkSizePolling = "FixedChunkSizePolling"
|
|
1141
|
+
}
|
|
1142
|
+
const enum PollingWatchKind {
|
|
1143
|
+
FixedInterval = "FixedInterval",
|
|
1144
|
+
PriorityInterval = "PriorityInterval",
|
|
1145
|
+
DynamicPriority = "DynamicPriority",
|
|
1146
|
+
FixedChunkSize = "FixedChunkSize"
|
|
1147
|
+
}
|
|
1148
|
+
export interface WatchOptions {
|
|
1149
|
+
watchFile?: WatchFileKind | ts.WatchFileKind;
|
|
1150
|
+
watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;
|
|
1151
|
+
fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;
|
|
1152
|
+
synchronousWatchDirectory?: boolean;
|
|
1153
|
+
excludeDirectories?: string[];
|
|
1154
|
+
excludeFiles?: string[];
|
|
1155
|
+
[option: string]: CompilerOptionsValue | undefined;
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Configure request; value of command field is "configure". Specifies
|
|
1159
|
+
* host information, such as host type, tab size, and indent size.
|
|
1160
|
+
*/
|
|
1161
|
+
export interface ConfigureRequest extends Request {
|
|
1162
|
+
command: CommandTypes.Configure;
|
|
1163
|
+
arguments: ConfigureRequestArguments;
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* Response to "configure" request. This is just an acknowledgement, so
|
|
1167
|
+
* no body field is required.
|
|
1168
|
+
*/
|
|
1169
|
+
export interface ConfigureResponse extends Response {
|
|
1170
|
+
}
|
|
1171
|
+
export interface ConfigurePluginRequestArguments {
|
|
1172
|
+
pluginName: string;
|
|
1173
|
+
configuration: any;
|
|
1174
|
+
}
|
|
1175
|
+
export interface ConfigurePluginRequest extends Request {
|
|
1176
|
+
command: CommandTypes.ConfigurePlugin;
|
|
1177
|
+
arguments: ConfigurePluginRequestArguments;
|
|
1178
|
+
}
|
|
1179
|
+
export interface ConfigurePluginResponse extends Response {
|
|
1180
|
+
}
|
|
1181
|
+
export interface SelectionRangeRequest extends FileRequest {
|
|
1182
|
+
command: CommandTypes.SelectionRange;
|
|
1183
|
+
arguments: SelectionRangeRequestArgs;
|
|
1184
|
+
}
|
|
1185
|
+
export interface SelectionRangeRequestArgs extends FileRequestArgs {
|
|
1186
|
+
locations: Location[];
|
|
1187
|
+
}
|
|
1188
|
+
export interface SelectionRangeResponse extends Response {
|
|
1189
|
+
body?: SelectionRange[];
|
|
1190
|
+
}
|
|
1191
|
+
export interface SelectionRange {
|
|
1192
|
+
textSpan: TextSpan;
|
|
1193
|
+
parent?: SelectionRange;
|
|
1194
|
+
}
|
|
1195
|
+
export interface ToggleLineCommentRequest extends FileRequest {
|
|
1196
|
+
command: CommandTypes.ToggleLineComment;
|
|
1197
|
+
arguments: FileRangeRequestArgs;
|
|
1198
|
+
}
|
|
1199
|
+
export interface ToggleMultilineCommentRequest extends FileRequest {
|
|
1200
|
+
command: CommandTypes.ToggleMultilineComment;
|
|
1201
|
+
arguments: FileRangeRequestArgs;
|
|
1202
|
+
}
|
|
1203
|
+
export interface CommentSelectionRequest extends FileRequest {
|
|
1204
|
+
command: CommandTypes.CommentSelection;
|
|
1205
|
+
arguments: FileRangeRequestArgs;
|
|
1206
|
+
}
|
|
1207
|
+
export interface UncommentSelectionRequest extends FileRequest {
|
|
1208
|
+
command: CommandTypes.UncommentSelection;
|
|
1209
|
+
arguments: FileRangeRequestArgs;
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Information found in an "open" request.
|
|
1213
|
+
*/
|
|
1214
|
+
export interface OpenRequestArgs extends FileRequestArgs {
|
|
1215
|
+
/**
|
|
1216
|
+
* Used when a version of the file content is known to be more up to date than the one on disk.
|
|
1217
|
+
* Then the known content will be used upon opening instead of the disk copy
|
|
1218
|
+
*/
|
|
1219
|
+
fileContent?: string;
|
|
1220
|
+
/**
|
|
1221
|
+
* Used to specify the script kind of the file explicitly. It could be one of the following:
|
|
1222
|
+
* "TS", "JS", "TSX", "JSX"
|
|
1223
|
+
*/
|
|
1224
|
+
scriptKindName?: ScriptKindName;
|
|
1225
|
+
/**
|
|
1226
|
+
* Used to limit the searching for project config file. If given the searching will stop at this
|
|
1227
|
+
* root path; otherwise it will go all the way up to the dist root path.
|
|
1228
|
+
*/
|
|
1229
|
+
projectRootPath?: string;
|
|
1230
|
+
}
|
|
1231
|
+
type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
|
|
1232
|
+
/**
|
|
1233
|
+
* Open request; value of command field is "open". Notify the
|
|
1234
|
+
* server that the client has file open. The server will not
|
|
1235
|
+
* monitor the filesystem for changes in this file and will assume
|
|
1236
|
+
* that the client is updating the server (using the change and/or
|
|
1237
|
+
* reload messages) when the file changes. Server does not currently
|
|
1238
|
+
* send a response to an open request.
|
|
1239
|
+
*/
|
|
1240
|
+
export interface OpenRequest extends Request {
|
|
1241
|
+
command: CommandTypes.Open;
|
|
1242
|
+
arguments: OpenRequestArgs;
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Request to open or update external project
|
|
1246
|
+
*/
|
|
1247
|
+
export interface OpenExternalProjectRequest extends Request {
|
|
1248
|
+
command: CommandTypes.OpenExternalProject;
|
|
1249
|
+
arguments: OpenExternalProjectArgs;
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Arguments to OpenExternalProjectRequest request
|
|
1253
|
+
*/
|
|
1254
|
+
type OpenExternalProjectArgs = ExternalProject;
|
|
1255
|
+
/**
|
|
1256
|
+
* Request to open multiple external projects
|
|
1257
|
+
*/
|
|
1258
|
+
export interface OpenExternalProjectsRequest extends Request {
|
|
1259
|
+
command: CommandTypes.OpenExternalProjects;
|
|
1260
|
+
arguments: OpenExternalProjectsArgs;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Arguments to OpenExternalProjectsRequest
|
|
1264
|
+
*/
|
|
1265
|
+
export interface OpenExternalProjectsArgs {
|
|
1266
|
+
/**
|
|
1267
|
+
* List of external projects to open or update
|
|
1268
|
+
*/
|
|
1269
|
+
projects: ExternalProject[];
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
|
|
1273
|
+
* no body field is required.
|
|
1274
|
+
*/
|
|
1275
|
+
export interface OpenExternalProjectResponse extends Response {
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
|
|
1279
|
+
* no body field is required.
|
|
1280
|
+
*/
|
|
1281
|
+
export interface OpenExternalProjectsResponse extends Response {
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Request to close external project.
|
|
1285
|
+
*/
|
|
1286
|
+
export interface CloseExternalProjectRequest extends Request {
|
|
1287
|
+
command: CommandTypes.CloseExternalProject;
|
|
1288
|
+
arguments: CloseExternalProjectRequestArgs;
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Arguments to CloseExternalProjectRequest request
|
|
1292
|
+
*/
|
|
1293
|
+
export interface CloseExternalProjectRequestArgs {
|
|
1294
|
+
/**
|
|
1295
|
+
* Name of the project to close
|
|
1296
|
+
*/
|
|
1297
|
+
projectFileName: string;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
|
|
1301
|
+
* no body field is required.
|
|
1302
|
+
*/
|
|
1303
|
+
export interface CloseExternalProjectResponse extends Response {
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Request to synchronize list of open files with the client
|
|
1307
|
+
*/
|
|
1308
|
+
export interface UpdateOpenRequest extends Request {
|
|
1309
|
+
command: CommandTypes.UpdateOpen;
|
|
1310
|
+
arguments: UpdateOpenRequestArgs;
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Arguments to UpdateOpenRequest
|
|
1314
|
+
*/
|
|
1315
|
+
export interface UpdateOpenRequestArgs {
|
|
1316
|
+
/**
|
|
1317
|
+
* List of newly open files
|
|
1318
|
+
*/
|
|
1319
|
+
openFiles?: OpenRequestArgs[];
|
|
1320
|
+
/**
|
|
1321
|
+
* List of open files files that were changes
|
|
1322
|
+
*/
|
|
1323
|
+
changedFiles?: FileCodeEdits[];
|
|
1324
|
+
/**
|
|
1325
|
+
* List of files that were closed
|
|
1326
|
+
*/
|
|
1327
|
+
closedFiles?: string[];
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
|
|
1331
|
+
*/
|
|
1332
|
+
type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
|
|
1333
|
+
/**
|
|
1334
|
+
* Request to set compiler options for inferred projects.
|
|
1335
|
+
* External projects are opened / closed explicitly.
|
|
1336
|
+
* Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.
|
|
1337
|
+
* This configuration file will be used to obtain a list of files and configuration settings for the project.
|
|
1338
|
+
* Inferred projects are created when user opens a loose file that is not the part of external project
|
|
1339
|
+
* or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
|
|
1340
|
+
* or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
|
|
1341
|
+
*/
|
|
1342
|
+
export interface SetCompilerOptionsForInferredProjectsRequest extends Request {
|
|
1343
|
+
command: CommandTypes.CompilerOptionsForInferredProjects;
|
|
1344
|
+
arguments: SetCompilerOptionsForInferredProjectsArgs;
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Argument for SetCompilerOptionsForInferredProjectsRequest request.
|
|
1348
|
+
*/
|
|
1349
|
+
export interface SetCompilerOptionsForInferredProjectsArgs {
|
|
1350
|
+
/**
|
|
1351
|
+
* Compiler options to be used with inferred projects.
|
|
1352
|
+
*/
|
|
1353
|
+
options: InferredProjectCompilerOptions;
|
|
1354
|
+
/**
|
|
1355
|
+
* Specifies the project root path used to scope compiler options.
|
|
1356
|
+
* It is an error to provide this property if the server has not been started with
|
|
1357
|
+
* `useInferredProjectPerProjectRoot` enabled.
|
|
1358
|
+
*/
|
|
1359
|
+
projectRootPath?: string;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
|
|
1363
|
+
* no body field is required.
|
|
1364
|
+
*/
|
|
1365
|
+
export interface SetCompilerOptionsForInferredProjectsResponse extends Response {
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Exit request; value of command field is "exit". Ask the server process
|
|
1369
|
+
* to exit.
|
|
1370
|
+
*/
|
|
1371
|
+
export interface ExitRequest extends Request {
|
|
1372
|
+
command: CommandTypes.Exit;
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Close request; value of command field is "close". Notify the
|
|
1376
|
+
* server that the client has closed a previously open file. If
|
|
1377
|
+
* file is still referenced by open files, the server will resume
|
|
1378
|
+
* monitoring the filesystem for changes to file. Server does not
|
|
1379
|
+
* currently send a response to a close request.
|
|
1380
|
+
*/
|
|
1381
|
+
export interface CloseRequest extends FileRequest {
|
|
1382
|
+
command: CommandTypes.Close;
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* Request to obtain the list of files that should be regenerated if target file is recompiled.
|
|
1386
|
+
* NOTE: this us query-only operation and does not generate any output on disk.
|
|
1387
|
+
*/
|
|
1388
|
+
export interface CompileOnSaveAffectedFileListRequest extends FileRequest {
|
|
1389
|
+
command: CommandTypes.CompileOnSaveAffectedFileList;
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Contains a list of files that should be regenerated in a project
|
|
1393
|
+
*/
|
|
1394
|
+
export interface CompileOnSaveAffectedFileListSingleProject {
|
|
1395
|
+
/**
|
|
1396
|
+
* Project name
|
|
1397
|
+
*/
|
|
1398
|
+
projectFileName: string;
|
|
1399
|
+
/**
|
|
1400
|
+
* List of files names that should be recompiled
|
|
1401
|
+
*/
|
|
1402
|
+
fileNames: string[];
|
|
1403
|
+
/**
|
|
1404
|
+
* true if project uses outFile or out compiler option
|
|
1405
|
+
*/
|
|
1406
|
+
projectUsesOutFile: boolean;
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Response for CompileOnSaveAffectedFileListRequest request;
|
|
1410
|
+
*/
|
|
1411
|
+
export interface CompileOnSaveAffectedFileListResponse extends Response {
|
|
1412
|
+
body: CompileOnSaveAffectedFileListSingleProject[];
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
|
|
1416
|
+
*/
|
|
1417
|
+
export interface CompileOnSaveEmitFileRequest extends FileRequest {
|
|
1418
|
+
command: CommandTypes.CompileOnSaveEmitFile;
|
|
1419
|
+
arguments: CompileOnSaveEmitFileRequestArgs;
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Arguments for CompileOnSaveEmitFileRequest
|
|
1423
|
+
*/
|
|
1424
|
+
export interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
|
|
1425
|
+
/**
|
|
1426
|
+
* if true - then file should be recompiled even if it does not have any changes.
|
|
1427
|
+
*/
|
|
1428
|
+
forced?: boolean;
|
|
1429
|
+
includeLinePosition?: boolean;
|
|
1430
|
+
/** if true - return response as object with emitSkipped and diagnostics */
|
|
1431
|
+
richResponse?: boolean;
|
|
1432
|
+
}
|
|
1433
|
+
export interface CompileOnSaveEmitFileResponse extends Response {
|
|
1434
|
+
body: boolean | EmitResult;
|
|
1435
|
+
}
|
|
1436
|
+
export interface EmitResult {
|
|
1437
|
+
emitSkipped: boolean;
|
|
1438
|
+
diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Quickinfo request; value of command field is
|
|
1442
|
+
* "quickinfo". Return response giving a quick type and
|
|
1443
|
+
* documentation string for the symbol found in file at location
|
|
1444
|
+
* line, col.
|
|
1445
|
+
*/
|
|
1446
|
+
export interface QuickInfoRequest extends FileLocationRequest {
|
|
1447
|
+
command: CommandTypes.Quickinfo;
|
|
1448
|
+
arguments: FileLocationRequestArgs;
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* Body of QuickInfoResponse.
|
|
1452
|
+
*/
|
|
1453
|
+
export interface QuickInfoResponseBody {
|
|
1454
|
+
/**
|
|
1455
|
+
* The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
|
|
1456
|
+
*/
|
|
1457
|
+
kind: ScriptElementKind;
|
|
1458
|
+
/**
|
|
1459
|
+
* Optional modifiers for the kind (such as 'public').
|
|
1460
|
+
*/
|
|
1461
|
+
kindModifiers: string;
|
|
1462
|
+
/**
|
|
1463
|
+
* Starting file location of symbol.
|
|
1464
|
+
*/
|
|
1465
|
+
start: Location;
|
|
1466
|
+
/**
|
|
1467
|
+
* One past last character of symbol.
|
|
1468
|
+
*/
|
|
1469
|
+
end: Location;
|
|
1470
|
+
/**
|
|
1471
|
+
* Type and kind of symbol.
|
|
1472
|
+
*/
|
|
1473
|
+
displayString: string;
|
|
1474
|
+
/**
|
|
1475
|
+
* Documentation associated with symbol.
|
|
1476
|
+
* Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
|
|
1477
|
+
*/
|
|
1478
|
+
documentation: string | SymbolDisplayPart[];
|
|
1479
|
+
/**
|
|
1480
|
+
* JSDoc tags associated with symbol.
|
|
1481
|
+
*/
|
|
1482
|
+
tags: JSDocTagInfo[];
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Quickinfo response message.
|
|
1486
|
+
*/
|
|
1487
|
+
export interface QuickInfoResponse extends Response {
|
|
1488
|
+
body?: QuickInfoResponseBody;
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Arguments for format messages.
|
|
1492
|
+
*/
|
|
1493
|
+
export interface FormatRequestArgs extends FileLocationRequestArgs {
|
|
1494
|
+
/**
|
|
1495
|
+
* Last line of range for which to format text in file.
|
|
1496
|
+
*/
|
|
1497
|
+
endLine: number;
|
|
1498
|
+
/**
|
|
1499
|
+
* Character offset on last line of range for which to format text in file.
|
|
1500
|
+
*/
|
|
1501
|
+
endOffset: number;
|
|
1502
|
+
/**
|
|
1503
|
+
* Format options to be used.
|
|
1504
|
+
*/
|
|
1505
|
+
options?: FormatCodeSettings;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Format request; value of command field is "format". Return
|
|
1509
|
+
* response giving zero or more edit instructions. The edit
|
|
1510
|
+
* instructions will be sorted in file order. Applying the edit
|
|
1511
|
+
* instructions in reverse to file will result in correctly
|
|
1512
|
+
* reformatted text.
|
|
1513
|
+
*/
|
|
1514
|
+
export interface FormatRequest extends FileLocationRequest {
|
|
1515
|
+
command: CommandTypes.Format;
|
|
1516
|
+
arguments: FormatRequestArgs;
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Object found in response messages defining an editing
|
|
1520
|
+
* instruction for a span of text in source code. The effect of
|
|
1521
|
+
* this instruction is to replace the text starting at start and
|
|
1522
|
+
* ending one character before end with newText. For an insertion,
|
|
1523
|
+
* the text span is empty. For a deletion, newText is empty.
|
|
1524
|
+
*/
|
|
1525
|
+
export interface CodeEdit {
|
|
1526
|
+
/**
|
|
1527
|
+
* First character of the text span to edit.
|
|
1528
|
+
*/
|
|
1529
|
+
start: Location;
|
|
1530
|
+
/**
|
|
1531
|
+
* One character past last character of the text span to edit.
|
|
1532
|
+
*/
|
|
1533
|
+
end: Location;
|
|
1534
|
+
/**
|
|
1535
|
+
* Replace the span defined above with this string (may be
|
|
1536
|
+
* the empty string).
|
|
1537
|
+
*/
|
|
1538
|
+
newText: string;
|
|
1539
|
+
}
|
|
1540
|
+
export interface FileCodeEdits {
|
|
1541
|
+
fileName: string;
|
|
1542
|
+
textChanges: CodeEdit[];
|
|
1543
|
+
}
|
|
1544
|
+
export interface CodeFixResponse extends Response {
|
|
1545
|
+
/** The code actions that are available */
|
|
1546
|
+
body?: CodeFixAction[];
|
|
1547
|
+
}
|
|
1548
|
+
export interface CodeAction {
|
|
1549
|
+
/** Description of the code action to display in the UI of the editor */
|
|
1550
|
+
description: string;
|
|
1551
|
+
/** Text changes to apply to each file as part of the code action */
|
|
1552
|
+
changes: FileCodeEdits[];
|
|
1553
|
+
/** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
|
|
1554
|
+
commands?: {}[];
|
|
1555
|
+
}
|
|
1556
|
+
export interface CombinedCodeActions {
|
|
1557
|
+
changes: readonly FileCodeEdits[];
|
|
1558
|
+
commands?: readonly {}[];
|
|
1559
|
+
}
|
|
1560
|
+
export interface CodeFixAction extends CodeAction {
|
|
1561
|
+
/** Short name to identify the fix, for use by telemetry. */
|
|
1562
|
+
fixName: string;
|
|
1563
|
+
/**
|
|
1564
|
+
* If present, one may call 'getCombinedCodeFix' with this fixId.
|
|
1565
|
+
* This may be omitted to indicate that the code fix can't be applied in a group.
|
|
1566
|
+
*/
|
|
1567
|
+
fixId?: {};
|
|
1568
|
+
/** Should be present if and only if 'fixId' is. */
|
|
1569
|
+
fixAllDescription?: string;
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Format and format on key response message.
|
|
1573
|
+
*/
|
|
1574
|
+
export interface FormatResponse extends Response {
|
|
1575
|
+
body?: CodeEdit[];
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* Arguments for format on key messages.
|
|
1579
|
+
*/
|
|
1580
|
+
export interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
|
|
1581
|
+
/**
|
|
1582
|
+
* Key pressed (';', '\n', or '}').
|
|
1583
|
+
*/
|
|
1584
|
+
key: string;
|
|
1585
|
+
options?: FormatCodeSettings;
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
* Format on key request; value of command field is
|
|
1589
|
+
* "formatonkey". Given file location and key typed (as string),
|
|
1590
|
+
* return response giving zero or more edit instructions. The
|
|
1591
|
+
* edit instructions will be sorted in file order. Applying the
|
|
1592
|
+
* edit instructions in reverse to file will result in correctly
|
|
1593
|
+
* reformatted text.
|
|
1594
|
+
*/
|
|
1595
|
+
export interface FormatOnKeyRequest extends FileLocationRequest {
|
|
1596
|
+
command: CommandTypes.Formatonkey;
|
|
1597
|
+
arguments: FormatOnKeyRequestArgs;
|
|
1598
|
+
}
|
|
1599
|
+
type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " ";
|
|
1600
|
+
const enum CompletionTriggerKind {
|
|
1601
|
+
/** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
|
|
1602
|
+
Invoked = 1,
|
|
1603
|
+
/** Completion was triggered by a trigger character. */
|
|
1604
|
+
TriggerCharacter = 2,
|
|
1605
|
+
/** Completion was re-triggered as the current completion list is incomplete. */
|
|
1606
|
+
TriggerForIncompleteCompletions = 3
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Arguments for completions messages.
|
|
1610
|
+
*/
|
|
1611
|
+
export interface CompletionsRequestArgs extends FileLocationRequestArgs {
|
|
1612
|
+
/**
|
|
1613
|
+
* Optional prefix to apply to possible completions.
|
|
1614
|
+
*/
|
|
1615
|
+
prefix?: string;
|
|
1616
|
+
/**
|
|
1617
|
+
* Character that was responsible for triggering completion.
|
|
1618
|
+
* Should be `undefined` if a user manually requested completion.
|
|
1619
|
+
*/
|
|
1620
|
+
triggerCharacter?: CompletionsTriggerCharacter;
|
|
1621
|
+
triggerKind?: CompletionTriggerKind;
|
|
1622
|
+
/**
|
|
1623
|
+
* @deprecated Use UserPreferences.includeCompletionsForModuleExports
|
|
1624
|
+
*/
|
|
1625
|
+
includeExternalModuleExports?: boolean;
|
|
1626
|
+
/**
|
|
1627
|
+
* @deprecated Use UserPreferences.includeCompletionsWithInsertText
|
|
1628
|
+
*/
|
|
1629
|
+
includeInsertTextCompletions?: boolean;
|
|
1630
|
+
}
|
|
1631
|
+
/**
|
|
1632
|
+
* Completions request; value of command field is "completions".
|
|
1633
|
+
* Given a file location (file, line, col) and a prefix (which may
|
|
1634
|
+
* be the empty string), return the possible completions that
|
|
1635
|
+
* begin with prefix.
|
|
1636
|
+
*/
|
|
1637
|
+
export interface CompletionsRequest extends FileLocationRequest {
|
|
1638
|
+
command: CommandTypes.Completions | CommandTypes.CompletionInfo;
|
|
1639
|
+
arguments: CompletionsRequestArgs;
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Arguments for completion details request.
|
|
1643
|
+
*/
|
|
1644
|
+
export interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
|
|
1645
|
+
/**
|
|
1646
|
+
* Names of one or more entries for which to obtain details.
|
|
1647
|
+
*/
|
|
1648
|
+
entryNames: (string | CompletionEntryIdentifier)[];
|
|
1649
|
+
}
|
|
1650
|
+
export interface CompletionEntryIdentifier {
|
|
1651
|
+
name: string;
|
|
1652
|
+
source?: string;
|
|
1653
|
+
data?: unknown;
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Completion entry details request; value of command field is
|
|
1657
|
+
* "completionEntryDetails". Given a file location (file, line,
|
|
1658
|
+
* col) and an array of completion entry names return more
|
|
1659
|
+
* detailed information for each completion entry.
|
|
1660
|
+
*/
|
|
1661
|
+
export interface CompletionDetailsRequest extends FileLocationRequest {
|
|
1662
|
+
command: CommandTypes.CompletionDetails;
|
|
1663
|
+
arguments: CompletionDetailsRequestArgs;
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* Part of a symbol description.
|
|
1667
|
+
*/
|
|
1668
|
+
export interface SymbolDisplayPart {
|
|
1669
|
+
/**
|
|
1670
|
+
* Text of an item describing the symbol.
|
|
1671
|
+
*/
|
|
1672
|
+
text: string;
|
|
1673
|
+
/**
|
|
1674
|
+
* The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
|
|
1675
|
+
*/
|
|
1676
|
+
kind: string;
|
|
1677
|
+
}
|
|
1678
|
+
/** A part of a symbol description that links from a jsdoc @link tag to a declaration */
|
|
1679
|
+
export interface JSDocLinkDisplayPart extends SymbolDisplayPart {
|
|
1680
|
+
/** The location of the declaration that the @link tag links to. */
|
|
1681
|
+
target: FileSpan;
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* An item found in a completion response.
|
|
1685
|
+
*/
|
|
1686
|
+
export interface CompletionEntry {
|
|
1687
|
+
/**
|
|
1688
|
+
* The symbol's name.
|
|
1689
|
+
*/
|
|
1690
|
+
name: string;
|
|
1691
|
+
/**
|
|
1692
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
|
1693
|
+
*/
|
|
1694
|
+
kind: ScriptElementKind;
|
|
1695
|
+
/**
|
|
1696
|
+
* Optional modifiers for the kind (such as 'public').
|
|
1697
|
+
*/
|
|
1698
|
+
kindModifiers?: string;
|
|
1699
|
+
/**
|
|
1700
|
+
* A string that is used for comparing completion items so that they can be ordered. This
|
|
1701
|
+
* is often the same as the name but may be different in certain circumstances.
|
|
1702
|
+
*/
|
|
1703
|
+
sortText: string;
|
|
1704
|
+
/**
|
|
1705
|
+
* Text to insert instead of `name`.
|
|
1706
|
+
* This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
|
|
1707
|
+
* coupled with `replacementSpan` to replace a dotted access with a bracket access.
|
|
1708
|
+
*/
|
|
1709
|
+
insertText?: string;
|
|
1710
|
+
/**
|
|
1711
|
+
* `insertText` should be interpreted as a snippet if true.
|
|
1712
|
+
*/
|
|
1713
|
+
isSnippet?: true;
|
|
1714
|
+
/**
|
|
1715
|
+
* An optional span that indicates the text to be replaced by this completion item.
|
|
1716
|
+
* If present, this span should be used instead of the default one.
|
|
1717
|
+
* It will be set if the required span differs from the one generated by the default replacement behavior.
|
|
1718
|
+
*/
|
|
1719
|
+
replacementSpan?: TextSpan;
|
|
1720
|
+
/**
|
|
1721
|
+
* Indicates whether commiting this completion entry will require additional code actions to be
|
|
1722
|
+
* made to avoid errors. The CompletionEntryDetails will have these actions.
|
|
1723
|
+
*/
|
|
1724
|
+
hasAction?: true;
|
|
1725
|
+
/**
|
|
1726
|
+
* Identifier (not necessarily human-readable) identifying where this completion came from.
|
|
1727
|
+
*/
|
|
1728
|
+
source?: string;
|
|
1729
|
+
/**
|
|
1730
|
+
* Human-readable description of the `source`.
|
|
1731
|
+
*/
|
|
1732
|
+
sourceDisplay?: SymbolDisplayPart[];
|
|
1733
|
+
/**
|
|
1734
|
+
* Additional details for the label.
|
|
1735
|
+
*/
|
|
1736
|
+
labelDetails?: CompletionEntryLabelDetails;
|
|
1737
|
+
/**
|
|
1738
|
+
* If true, this completion should be highlighted as recommended. There will only be one of these.
|
|
1739
|
+
* This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
|
|
1740
|
+
* Then either that enum/class or a namespace containing it will be the recommended symbol.
|
|
1741
|
+
*/
|
|
1742
|
+
isRecommended?: true;
|
|
1743
|
+
/**
|
|
1744
|
+
* If true, this completion was generated from traversing the name table of an unchecked JS file,
|
|
1745
|
+
* and therefore may not be accurate.
|
|
1746
|
+
*/
|
|
1747
|
+
isFromUncheckedFile?: true;
|
|
1748
|
+
/**
|
|
1749
|
+
* If true, this completion was for an auto-import of a module not yet in the program, but listed
|
|
1750
|
+
* in the project package.json. Used for telemetry reporting.
|
|
1751
|
+
*/
|
|
1752
|
+
isPackageJsonImport?: true;
|
|
1753
|
+
/**
|
|
1754
|
+
* If true, this completion was an auto-import-style completion of an import statement (i.e., the
|
|
1755
|
+
* module specifier was inserted along with the imported identifier). Used for telemetry reporting.
|
|
1756
|
+
*/
|
|
1757
|
+
isImportStatementCompletion?: true;
|
|
1758
|
+
/**
|
|
1759
|
+
* A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
|
|
1760
|
+
* that allows TS Server to look up the symbol represented by the completion item, disambiguating
|
|
1761
|
+
* items with the same name.
|
|
1762
|
+
*/
|
|
1763
|
+
data?: unknown;
|
|
1764
|
+
}
|
|
1765
|
+
export interface CompletionEntryLabelDetails {
|
|
1766
|
+
/**
|
|
1767
|
+
* An optional string which is rendered less prominently directly after
|
|
1768
|
+
* {@link CompletionEntry.name name}, without any spacing. Should be
|
|
1769
|
+
* used for function signatures or type annotations.
|
|
1770
|
+
*/
|
|
1771
|
+
detail?: string;
|
|
1772
|
+
/**
|
|
1773
|
+
* An optional string which is rendered less prominently after
|
|
1774
|
+
* {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified
|
|
1775
|
+
* names or file path.
|
|
1776
|
+
*/
|
|
1777
|
+
description?: string;
|
|
1778
|
+
}
|
|
1779
|
+
/**
|
|
1780
|
+
* Additional completion entry details, available on demand
|
|
1781
|
+
*/
|
|
1782
|
+
export interface CompletionEntryDetails {
|
|
1783
|
+
/**
|
|
1784
|
+
* The symbol's name.
|
|
1785
|
+
*/
|
|
1786
|
+
name: string;
|
|
1787
|
+
/**
|
|
1788
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
|
1789
|
+
*/
|
|
1790
|
+
kind: ScriptElementKind;
|
|
1791
|
+
/**
|
|
1792
|
+
* Optional modifiers for the kind (such as 'public').
|
|
1793
|
+
*/
|
|
1794
|
+
kindModifiers: string;
|
|
1795
|
+
/**
|
|
1796
|
+
* Display parts of the symbol (similar to quick info).
|
|
1797
|
+
*/
|
|
1798
|
+
displayParts: SymbolDisplayPart[];
|
|
1799
|
+
/**
|
|
1800
|
+
* Documentation strings for the symbol.
|
|
1801
|
+
*/
|
|
1802
|
+
documentation?: SymbolDisplayPart[];
|
|
1803
|
+
/**
|
|
1804
|
+
* JSDoc tags for the symbol.
|
|
1805
|
+
*/
|
|
1806
|
+
tags?: JSDocTagInfo[];
|
|
1807
|
+
/**
|
|
1808
|
+
* The associated code actions for this entry
|
|
1809
|
+
*/
|
|
1810
|
+
codeActions?: CodeAction[];
|
|
1811
|
+
/**
|
|
1812
|
+
* @deprecated Use `sourceDisplay` instead.
|
|
1813
|
+
*/
|
|
1814
|
+
source?: SymbolDisplayPart[];
|
|
1815
|
+
/**
|
|
1816
|
+
* Human-readable description of the `source` from the CompletionEntry.
|
|
1817
|
+
*/
|
|
1818
|
+
sourceDisplay?: SymbolDisplayPart[];
|
|
1819
|
+
}
|
|
1820
|
+
/** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
|
|
1821
|
+
export interface CompletionsResponse extends Response {
|
|
1822
|
+
body?: CompletionEntry[];
|
|
1823
|
+
}
|
|
1824
|
+
export interface CompletionInfoResponse extends Response {
|
|
1825
|
+
body?: CompletionInfo;
|
|
1826
|
+
}
|
|
1827
|
+
export interface CompletionInfo {
|
|
1828
|
+
readonly flags?: number;
|
|
1829
|
+
readonly isGlobalCompletion: boolean;
|
|
1830
|
+
readonly isMemberCompletion: boolean;
|
|
1831
|
+
readonly isNewIdentifierLocation: boolean;
|
|
1832
|
+
/**
|
|
1833
|
+
* In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
|
|
1834
|
+
* this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
|
|
1835
|
+
* must be used to commit that completion entry.
|
|
1836
|
+
*/
|
|
1837
|
+
readonly optionalReplacementSpan?: TextSpan;
|
|
1838
|
+
readonly isIncomplete?: boolean;
|
|
1839
|
+
readonly entries: readonly CompletionEntry[];
|
|
1840
|
+
}
|
|
1841
|
+
export interface CompletionDetailsResponse extends Response {
|
|
1842
|
+
body?: CompletionEntryDetails[];
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* Signature help information for a single parameter
|
|
1846
|
+
*/
|
|
1847
|
+
export interface SignatureHelpParameter {
|
|
1848
|
+
/**
|
|
1849
|
+
* The parameter's name
|
|
1850
|
+
*/
|
|
1851
|
+
name: string;
|
|
1852
|
+
/**
|
|
1853
|
+
* Documentation of the parameter.
|
|
1854
|
+
*/
|
|
1855
|
+
documentation: SymbolDisplayPart[];
|
|
1856
|
+
/**
|
|
1857
|
+
* Display parts of the parameter.
|
|
1858
|
+
*/
|
|
1859
|
+
displayParts: SymbolDisplayPart[];
|
|
1860
|
+
/**
|
|
1861
|
+
* Whether the parameter is optional or not.
|
|
1862
|
+
*/
|
|
1863
|
+
isOptional: boolean;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Represents a single signature to show in signature help.
|
|
1867
|
+
*/
|
|
1868
|
+
export interface SignatureHelpItem {
|
|
1869
|
+
/**
|
|
1870
|
+
* Whether the signature accepts a variable number of arguments.
|
|
1871
|
+
*/
|
|
1872
|
+
isVariadic: boolean;
|
|
1873
|
+
/**
|
|
1874
|
+
* The prefix display parts.
|
|
1875
|
+
*/
|
|
1876
|
+
prefixDisplayParts: SymbolDisplayPart[];
|
|
1877
|
+
/**
|
|
1878
|
+
* The suffix display parts.
|
|
1879
|
+
*/
|
|
1880
|
+
suffixDisplayParts: SymbolDisplayPart[];
|
|
1881
|
+
/**
|
|
1882
|
+
* The separator display parts.
|
|
1883
|
+
*/
|
|
1884
|
+
separatorDisplayParts: SymbolDisplayPart[];
|
|
1885
|
+
/**
|
|
1886
|
+
* The signature helps items for the parameters.
|
|
1887
|
+
*/
|
|
1888
|
+
parameters: SignatureHelpParameter[];
|
|
1889
|
+
/**
|
|
1890
|
+
* The signature's documentation
|
|
1891
|
+
*/
|
|
1892
|
+
documentation: SymbolDisplayPart[];
|
|
1893
|
+
/**
|
|
1894
|
+
* The signature's JSDoc tags
|
|
1895
|
+
*/
|
|
1896
|
+
tags: JSDocTagInfo[];
|
|
1897
|
+
}
|
|
1898
|
+
/**
|
|
1899
|
+
* Signature help items found in the response of a signature help request.
|
|
1900
|
+
*/
|
|
1901
|
+
export interface SignatureHelpItems {
|
|
1902
|
+
/**
|
|
1903
|
+
* The signature help items.
|
|
1904
|
+
*/
|
|
1905
|
+
items: SignatureHelpItem[];
|
|
1906
|
+
/**
|
|
1907
|
+
* The span for which signature help should appear on a signature
|
|
1908
|
+
*/
|
|
1909
|
+
applicableSpan: TextSpan;
|
|
1910
|
+
/**
|
|
1911
|
+
* The item selected in the set of available help items.
|
|
1912
|
+
*/
|
|
1913
|
+
selectedItemIndex: number;
|
|
1914
|
+
/**
|
|
1915
|
+
* The argument selected in the set of parameters.
|
|
1916
|
+
*/
|
|
1917
|
+
argumentIndex: number;
|
|
1918
|
+
/**
|
|
1919
|
+
* The argument count
|
|
1920
|
+
*/
|
|
1921
|
+
argumentCount: number;
|
|
1922
|
+
}
|
|
1923
|
+
type SignatureHelpTriggerCharacter = "," | "(" | "<";
|
|
1924
|
+
type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
|
|
1925
|
+
/**
|
|
1926
|
+
* Arguments of a signature help request.
|
|
1927
|
+
*/
|
|
1928
|
+
export interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
|
|
1929
|
+
/**
|
|
1930
|
+
* Reason why signature help was invoked.
|
|
1931
|
+
* See each individual possible
|
|
1932
|
+
*/
|
|
1933
|
+
triggerReason?: SignatureHelpTriggerReason;
|
|
1934
|
+
}
|
|
1935
|
+
type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
|
|
1936
|
+
/**
|
|
1937
|
+
* Signals that the user manually requested signature help.
|
|
1938
|
+
* The language service will unconditionally attempt to provide a result.
|
|
1939
|
+
*/
|
|
1940
|
+
export interface SignatureHelpInvokedReason {
|
|
1941
|
+
kind: "invoked";
|
|
1942
|
+
triggerCharacter?: undefined;
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Signals that the signature help request came from a user typing a character.
|
|
1946
|
+
* Depending on the character and the syntactic context, the request may or may not be served a result.
|
|
1947
|
+
*/
|
|
1948
|
+
export interface SignatureHelpCharacterTypedReason {
|
|
1949
|
+
kind: "characterTyped";
|
|
1950
|
+
/**
|
|
1951
|
+
* Character that was responsible for triggering signature help.
|
|
1952
|
+
*/
|
|
1953
|
+
triggerCharacter: SignatureHelpTriggerCharacter;
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Signals that this signature help request came from typing a character or moving the cursor.
|
|
1957
|
+
* This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
|
|
1958
|
+
* The language service will unconditionally attempt to provide a result.
|
|
1959
|
+
* `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
|
|
1960
|
+
*/
|
|
1961
|
+
export interface SignatureHelpRetriggeredReason {
|
|
1962
|
+
kind: "retrigger";
|
|
1963
|
+
/**
|
|
1964
|
+
* Character that was responsible for triggering signature help.
|
|
1965
|
+
*/
|
|
1966
|
+
triggerCharacter?: SignatureHelpRetriggerCharacter;
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Signature help request; value of command field is "signatureHelp".
|
|
1970
|
+
* Given a file location (file, line, col), return the signature
|
|
1971
|
+
* help.
|
|
1972
|
+
*/
|
|
1973
|
+
export interface SignatureHelpRequest extends FileLocationRequest {
|
|
1974
|
+
command: CommandTypes.SignatureHelp;
|
|
1975
|
+
arguments: SignatureHelpRequestArgs;
|
|
1976
|
+
}
|
|
1977
|
+
/**
|
|
1978
|
+
* Response object for a SignatureHelpRequest.
|
|
1979
|
+
*/
|
|
1980
|
+
export interface SignatureHelpResponse extends Response {
|
|
1981
|
+
body?: SignatureHelpItems;
|
|
1982
|
+
}
|
|
1983
|
+
type InlayHintKind = "Type" | "Parameter" | "Enum";
|
|
1984
|
+
export interface InlayHintsRequestArgs extends FileRequestArgs {
|
|
1985
|
+
/**
|
|
1986
|
+
* Start position of the span.
|
|
1987
|
+
*/
|
|
1988
|
+
start: number;
|
|
1989
|
+
/**
|
|
1990
|
+
* Length of the span.
|
|
1991
|
+
*/
|
|
1992
|
+
length: number;
|
|
1993
|
+
}
|
|
1994
|
+
export interface InlayHintsRequest extends Request {
|
|
1995
|
+
command: CommandTypes.ProvideInlayHints;
|
|
1996
|
+
arguments: InlayHintsRequestArgs;
|
|
1997
|
+
}
|
|
1998
|
+
export interface InlayHintItem {
|
|
1999
|
+
text: string;
|
|
2000
|
+
position: Location;
|
|
2001
|
+
kind: InlayHintKind;
|
|
2002
|
+
whitespaceBefore?: boolean;
|
|
2003
|
+
whitespaceAfter?: boolean;
|
|
2004
|
+
}
|
|
2005
|
+
export interface InlayHintsResponse extends Response {
|
|
2006
|
+
body?: InlayHintItem[];
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Synchronous request for semantic diagnostics of one file.
|
|
2010
|
+
*/
|
|
2011
|
+
export interface SemanticDiagnosticsSyncRequest extends FileRequest {
|
|
2012
|
+
command: CommandTypes.SemanticDiagnosticsSync;
|
|
2013
|
+
arguments: SemanticDiagnosticsSyncRequestArgs;
|
|
2014
|
+
}
|
|
2015
|
+
export interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
|
|
2016
|
+
includeLinePosition?: boolean;
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
* Response object for synchronous sematic diagnostics request.
|
|
2020
|
+
*/
|
|
2021
|
+
export interface SemanticDiagnosticsSyncResponse extends Response {
|
|
2022
|
+
body?: Diagnostic[] | DiagnosticWithLinePosition[];
|
|
2023
|
+
}
|
|
2024
|
+
export interface SuggestionDiagnosticsSyncRequest extends FileRequest {
|
|
2025
|
+
command: CommandTypes.SuggestionDiagnosticsSync;
|
|
2026
|
+
arguments: SuggestionDiagnosticsSyncRequestArgs;
|
|
2027
|
+
}
|
|
2028
|
+
type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
|
|
2029
|
+
/**
|
|
2030
|
+
* Synchronous request for syntactic diagnostics of one file.
|
|
2031
|
+
*/
|
|
2032
|
+
export interface SyntacticDiagnosticsSyncRequest extends FileRequest {
|
|
2033
|
+
command: CommandTypes.SyntacticDiagnosticsSync;
|
|
2034
|
+
arguments: SyntacticDiagnosticsSyncRequestArgs;
|
|
2035
|
+
}
|
|
2036
|
+
export interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
|
|
2037
|
+
includeLinePosition?: boolean;
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Response object for synchronous syntactic diagnostics request.
|
|
2041
|
+
*/
|
|
2042
|
+
export interface SyntacticDiagnosticsSyncResponse extends Response {
|
|
2043
|
+
body?: Diagnostic[] | DiagnosticWithLinePosition[];
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* Arguments for GeterrForProject request.
|
|
2047
|
+
*/
|
|
2048
|
+
export interface GeterrForProjectRequestArgs {
|
|
2049
|
+
/**
|
|
2050
|
+
* the file requesting project error list
|
|
2051
|
+
*/
|
|
2052
|
+
file: string;
|
|
2053
|
+
/**
|
|
2054
|
+
* Delay in milliseconds to wait before starting to compute
|
|
2055
|
+
* errors for the files in the file list
|
|
2056
|
+
*/
|
|
2057
|
+
delay: number;
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* GeterrForProjectRequest request; value of command field is
|
|
2061
|
+
* "geterrForProject". It works similarly with 'Geterr', only
|
|
2062
|
+
* it request for every file in this project.
|
|
2063
|
+
*/
|
|
2064
|
+
export interface GeterrForProjectRequest extends Request {
|
|
2065
|
+
command: CommandTypes.GeterrForProject;
|
|
2066
|
+
arguments: GeterrForProjectRequestArgs;
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Arguments for geterr messages.
|
|
2070
|
+
*/
|
|
2071
|
+
export interface GeterrRequestArgs {
|
|
2072
|
+
/**
|
|
2073
|
+
* List of file names for which to compute compiler errors.
|
|
2074
|
+
* The files will be checked in list order.
|
|
2075
|
+
*/
|
|
2076
|
+
files: string[];
|
|
2077
|
+
/**
|
|
2078
|
+
* Delay in milliseconds to wait before starting to compute
|
|
2079
|
+
* errors for the files in the file list
|
|
2080
|
+
*/
|
|
2081
|
+
delay: number;
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* Geterr request; value of command field is "geterr". Wait for
|
|
2085
|
+
* delay milliseconds and then, if during the wait no change or
|
|
2086
|
+
* reload messages have arrived for the first file in the files
|
|
2087
|
+
* list, get the syntactic errors for the file, field requests,
|
|
2088
|
+
* and then get the semantic errors for the file. Repeat with a
|
|
2089
|
+
* smaller delay for each subsequent file on the files list. Best
|
|
2090
|
+
* practice for an editor is to send a file list containing each
|
|
2091
|
+
* file that is currently visible, in most-recently-used order.
|
|
2092
|
+
*/
|
|
2093
|
+
export interface GeterrRequest extends Request {
|
|
2094
|
+
command: CommandTypes.Geterr;
|
|
2095
|
+
arguments: GeterrRequestArgs;
|
|
2096
|
+
}
|
|
2097
|
+
type RequestCompletedEventName = "requestCompleted";
|
|
2098
|
+
/**
|
|
2099
|
+
* Event that is sent when server have finished processing request with specified id.
|
|
2100
|
+
*/
|
|
2101
|
+
export interface RequestCompletedEvent extends Event {
|
|
2102
|
+
event: RequestCompletedEventName;
|
|
2103
|
+
body: RequestCompletedEventBody;
|
|
2104
|
+
}
|
|
2105
|
+
export interface RequestCompletedEventBody {
|
|
2106
|
+
request_seq: number;
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* Item of diagnostic information found in a DiagnosticEvent message.
|
|
2110
|
+
*/
|
|
2111
|
+
export interface Diagnostic {
|
|
2112
|
+
/**
|
|
2113
|
+
* Starting file location at which text applies.
|
|
2114
|
+
*/
|
|
2115
|
+
start: Location;
|
|
2116
|
+
/**
|
|
2117
|
+
* The last file location at which the text applies.
|
|
2118
|
+
*/
|
|
2119
|
+
end: Location;
|
|
2120
|
+
/**
|
|
2121
|
+
* Text of diagnostic message.
|
|
2122
|
+
*/
|
|
2123
|
+
text: string;
|
|
2124
|
+
/**
|
|
2125
|
+
* The category of the diagnostic message, e.g. "error", "warning", or "suggestion".
|
|
2126
|
+
*/
|
|
2127
|
+
category: string;
|
|
2128
|
+
reportsUnnecessary?: {};
|
|
2129
|
+
reportsDeprecated?: {};
|
|
2130
|
+
/**
|
|
2131
|
+
* Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites
|
|
2132
|
+
*/
|
|
2133
|
+
relatedInformation?: DiagnosticRelatedInformation[];
|
|
2134
|
+
/**
|
|
2135
|
+
* The error code of the diagnostic message.
|
|
2136
|
+
*/
|
|
2137
|
+
code?: number;
|
|
2138
|
+
/**
|
|
2139
|
+
* The name of the plugin reporting the message.
|
|
2140
|
+
*/
|
|
2141
|
+
source?: string;
|
|
2142
|
+
}
|
|
2143
|
+
export interface DiagnosticWithFileName extends Diagnostic {
|
|
2144
|
+
/**
|
|
2145
|
+
* Name of the file the diagnostic is in
|
|
2146
|
+
*/
|
|
2147
|
+
fileName: string;
|
|
2148
|
+
}
|
|
2149
|
+
/**
|
|
2150
|
+
* Represents additional spans returned with a diagnostic which are relevant to it
|
|
2151
|
+
*/
|
|
2152
|
+
export interface DiagnosticRelatedInformation {
|
|
2153
|
+
/**
|
|
2154
|
+
* The category of the related information message, e.g. "error", "warning", or "suggestion".
|
|
2155
|
+
*/
|
|
2156
|
+
category: string;
|
|
2157
|
+
/**
|
|
2158
|
+
* The code used ot identify the related information
|
|
2159
|
+
*/
|
|
2160
|
+
code: number;
|
|
2161
|
+
/**
|
|
2162
|
+
* Text of related or additional information.
|
|
2163
|
+
*/
|
|
2164
|
+
message: string;
|
|
2165
|
+
/**
|
|
2166
|
+
* Associated location
|
|
2167
|
+
*/
|
|
2168
|
+
span?: FileSpan;
|
|
2169
|
+
}
|
|
2170
|
+
export interface DiagnosticEventBody {
|
|
2171
|
+
/**
|
|
2172
|
+
* The file for which diagnostic information is reported.
|
|
2173
|
+
*/
|
|
2174
|
+
file: string;
|
|
2175
|
+
/**
|
|
2176
|
+
* An array of diagnostic information items.
|
|
2177
|
+
*/
|
|
2178
|
+
diagnostics: Diagnostic[];
|
|
2179
|
+
}
|
|
2180
|
+
type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
|
|
2181
|
+
/**
|
|
2182
|
+
* Event message for DiagnosticEventKind event types.
|
|
2183
|
+
* These events provide syntactic and semantic errors for a file.
|
|
2184
|
+
*/
|
|
2185
|
+
export interface DiagnosticEvent extends Event {
|
|
2186
|
+
body?: DiagnosticEventBody;
|
|
2187
|
+
event: DiagnosticEventKind;
|
|
2188
|
+
}
|
|
2189
|
+
export interface ConfigFileDiagnosticEventBody {
|
|
2190
|
+
/**
|
|
2191
|
+
* The file which trigged the searching and error-checking of the config file
|
|
2192
|
+
*/
|
|
2193
|
+
triggerFile: string;
|
|
2194
|
+
/**
|
|
2195
|
+
* The name of the found config file.
|
|
2196
|
+
*/
|
|
2197
|
+
configFile: string;
|
|
2198
|
+
/**
|
|
2199
|
+
* An arry of diagnostic information items for the found config file.
|
|
2200
|
+
*/
|
|
2201
|
+
diagnostics: DiagnosticWithFileName[];
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Event message for "configFileDiag" event type.
|
|
2205
|
+
* This event provides errors for a found config file.
|
|
2206
|
+
*/
|
|
2207
|
+
export interface ConfigFileDiagnosticEvent extends Event {
|
|
2208
|
+
body?: ConfigFileDiagnosticEventBody;
|
|
2209
|
+
event: "configFileDiag";
|
|
2210
|
+
}
|
|
2211
|
+
type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
|
|
2212
|
+
export interface ProjectLanguageServiceStateEvent extends Event {
|
|
2213
|
+
event: ProjectLanguageServiceStateEventName;
|
|
2214
|
+
body?: ProjectLanguageServiceStateEventBody;
|
|
2215
|
+
}
|
|
2216
|
+
export interface ProjectLanguageServiceStateEventBody {
|
|
2217
|
+
/**
|
|
2218
|
+
* Project name that has changes in the state of language service.
|
|
2219
|
+
* For configured projects this will be the config file path.
|
|
2220
|
+
* For external projects this will be the name of the projects specified when project was open.
|
|
2221
|
+
* For inferred projects this event is not raised.
|
|
2222
|
+
*/
|
|
2223
|
+
projectName: string;
|
|
2224
|
+
/**
|
|
2225
|
+
* True if language service state switched from disabled to enabled
|
|
2226
|
+
* and false otherwise.
|
|
2227
|
+
*/
|
|
2228
|
+
languageServiceEnabled: boolean;
|
|
2229
|
+
}
|
|
2230
|
+
type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
|
|
2231
|
+
export interface ProjectsUpdatedInBackgroundEvent extends Event {
|
|
2232
|
+
event: ProjectsUpdatedInBackgroundEventName;
|
|
2233
|
+
body: ProjectsUpdatedInBackgroundEventBody;
|
|
2234
|
+
}
|
|
2235
|
+
export interface ProjectsUpdatedInBackgroundEventBody {
|
|
2236
|
+
/**
|
|
2237
|
+
* Current set of open files
|
|
2238
|
+
*/
|
|
2239
|
+
openFiles: string[];
|
|
2240
|
+
}
|
|
2241
|
+
type ProjectLoadingStartEventName = "projectLoadingStart";
|
|
2242
|
+
export interface ProjectLoadingStartEvent extends Event {
|
|
2243
|
+
event: ProjectLoadingStartEventName;
|
|
2244
|
+
body: ProjectLoadingStartEventBody;
|
|
2245
|
+
}
|
|
2246
|
+
export interface ProjectLoadingStartEventBody {
|
|
2247
|
+
/** name of the project */
|
|
2248
|
+
projectName: string;
|
|
2249
|
+
/** reason for loading */
|
|
2250
|
+
reason: string;
|
|
2251
|
+
}
|
|
2252
|
+
type ProjectLoadingFinishEventName = "projectLoadingFinish";
|
|
2253
|
+
export interface ProjectLoadingFinishEvent extends Event {
|
|
2254
|
+
event: ProjectLoadingFinishEventName;
|
|
2255
|
+
body: ProjectLoadingFinishEventBody;
|
|
2256
|
+
}
|
|
2257
|
+
export interface ProjectLoadingFinishEventBody {
|
|
2258
|
+
/** name of the project */
|
|
2259
|
+
projectName: string;
|
|
2260
|
+
}
|
|
2261
|
+
type SurveyReadyEventName = "surveyReady";
|
|
2262
|
+
export interface SurveyReadyEvent extends Event {
|
|
2263
|
+
event: SurveyReadyEventName;
|
|
2264
|
+
body: SurveyReadyEventBody;
|
|
2265
|
+
}
|
|
2266
|
+
export interface SurveyReadyEventBody {
|
|
2267
|
+
/** Name of the survey. This is an internal machine- and programmer-friendly name */
|
|
2268
|
+
surveyId: string;
|
|
2269
|
+
}
|
|
2270
|
+
type LargeFileReferencedEventName = "largeFileReferenced";
|
|
2271
|
+
export interface LargeFileReferencedEvent extends Event {
|
|
2272
|
+
event: LargeFileReferencedEventName;
|
|
2273
|
+
body: LargeFileReferencedEventBody;
|
|
2274
|
+
}
|
|
2275
|
+
export interface LargeFileReferencedEventBody {
|
|
2276
|
+
/**
|
|
2277
|
+
* name of the large file being loaded
|
|
2278
|
+
*/
|
|
2279
|
+
file: string;
|
|
2280
|
+
/**
|
|
2281
|
+
* size of the file
|
|
2282
|
+
*/
|
|
2283
|
+
fileSize: number;
|
|
2284
|
+
/**
|
|
2285
|
+
* max file size allowed on the server
|
|
2286
|
+
*/
|
|
2287
|
+
maxFileSize: number;
|
|
2288
|
+
}
|
|
2289
|
+
/**
|
|
2290
|
+
* Arguments for reload request.
|
|
2291
|
+
*/
|
|
2292
|
+
export interface ReloadRequestArgs extends FileRequestArgs {
|
|
2293
|
+
/**
|
|
2294
|
+
* Name of temporary file from which to reload file
|
|
2295
|
+
* contents. May be same as file.
|
|
2296
|
+
*/
|
|
2297
|
+
tmpfile: string;
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Reload request message; value of command field is "reload".
|
|
2301
|
+
* Reload contents of file with name given by the 'file' argument
|
|
2302
|
+
* from temporary file with name given by the 'tmpfile' argument.
|
|
2303
|
+
* The two names can be identical.
|
|
2304
|
+
*/
|
|
2305
|
+
export interface ReloadRequest extends FileRequest {
|
|
2306
|
+
command: CommandTypes.Reload;
|
|
2307
|
+
arguments: ReloadRequestArgs;
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* Response to "reload" request. This is just an acknowledgement, so
|
|
2311
|
+
* no body field is required.
|
|
2312
|
+
*/
|
|
2313
|
+
export interface ReloadResponse extends Response {
|
|
2314
|
+
}
|
|
2315
|
+
/**
|
|
2316
|
+
* Arguments for saveto request.
|
|
2317
|
+
*/
|
|
2318
|
+
export interface SavetoRequestArgs extends FileRequestArgs {
|
|
2319
|
+
/**
|
|
2320
|
+
* Name of temporary file into which to save server's view of
|
|
2321
|
+
* file contents.
|
|
2322
|
+
*/
|
|
2323
|
+
tmpfile: string;
|
|
2324
|
+
}
|
|
2325
|
+
/**
|
|
2326
|
+
* Saveto request message; value of command field is "saveto".
|
|
2327
|
+
* For debugging purposes, save to a temporaryfile (named by
|
|
2328
|
+
* argument 'tmpfile') the contents of file named by argument
|
|
2329
|
+
* 'file'. The server does not currently send a response to a
|
|
2330
|
+
* "saveto" request.
|
|
2331
|
+
*/
|
|
2332
|
+
export interface SavetoRequest extends FileRequest {
|
|
2333
|
+
command: CommandTypes.Saveto;
|
|
2334
|
+
arguments: SavetoRequestArgs;
|
|
2335
|
+
}
|
|
2336
|
+
/**
|
|
2337
|
+
* Arguments for navto request message.
|
|
2338
|
+
*/
|
|
2339
|
+
export interface NavtoRequestArgs {
|
|
2340
|
+
/**
|
|
2341
|
+
* Search term to navigate to from current location; term can
|
|
2342
|
+
* be '.*' or an identifier prefix.
|
|
2343
|
+
*/
|
|
2344
|
+
searchValue: string;
|
|
2345
|
+
/**
|
|
2346
|
+
* Optional limit on the number of items to return.
|
|
2347
|
+
*/
|
|
2348
|
+
maxResultCount?: number;
|
|
2349
|
+
/**
|
|
2350
|
+
* The file for the request (absolute pathname required).
|
|
2351
|
+
*/
|
|
2352
|
+
file?: string;
|
|
2353
|
+
/**
|
|
2354
|
+
* Optional flag to indicate we want results for just the current file
|
|
2355
|
+
* or the entire project.
|
|
2356
|
+
*/
|
|
2357
|
+
currentFileOnly?: boolean;
|
|
2358
|
+
projectFileName?: string;
|
|
2359
|
+
}
|
|
2360
|
+
/**
|
|
2361
|
+
* Navto request message; value of command field is "navto".
|
|
2362
|
+
* Return list of objects giving file locations and symbols that
|
|
2363
|
+
* match the search term given in argument 'searchTerm'. The
|
|
2364
|
+
* context for the search is given by the named file.
|
|
2365
|
+
*/
|
|
2366
|
+
export interface NavtoRequest extends Request {
|
|
2367
|
+
command: CommandTypes.Navto;
|
|
2368
|
+
arguments: NavtoRequestArgs;
|
|
2369
|
+
}
|
|
2370
|
+
/**
|
|
2371
|
+
* An item found in a navto response.
|
|
2372
|
+
*/
|
|
2373
|
+
export interface NavtoItem extends FileSpan {
|
|
2374
|
+
/**
|
|
2375
|
+
* The symbol's name.
|
|
2376
|
+
*/
|
|
2377
|
+
name: string;
|
|
2378
|
+
/**
|
|
2379
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
|
2380
|
+
*/
|
|
2381
|
+
kind: ScriptElementKind;
|
|
2382
|
+
/**
|
|
2383
|
+
* exact, substring, or prefix.
|
|
2384
|
+
*/
|
|
2385
|
+
matchKind: string;
|
|
2386
|
+
/**
|
|
2387
|
+
* If this was a case sensitive or insensitive match.
|
|
2388
|
+
*/
|
|
2389
|
+
isCaseSensitive: boolean;
|
|
2390
|
+
/**
|
|
2391
|
+
* Optional modifiers for the kind (such as 'public').
|
|
2392
|
+
*/
|
|
2393
|
+
kindModifiers?: string;
|
|
2394
|
+
/**
|
|
2395
|
+
* Name of symbol's container symbol (if any); for example,
|
|
2396
|
+
* the class name if symbol is a class member.
|
|
2397
|
+
*/
|
|
2398
|
+
containerName?: string;
|
|
2399
|
+
/**
|
|
2400
|
+
* Kind of symbol's container symbol (if any).
|
|
2401
|
+
*/
|
|
2402
|
+
containerKind?: ScriptElementKind;
|
|
2403
|
+
}
|
|
2404
|
+
/**
|
|
2405
|
+
* Navto response message. Body is an array of navto items. Each
|
|
2406
|
+
* item gives a symbol that matched the search term.
|
|
2407
|
+
*/
|
|
2408
|
+
export interface NavtoResponse extends Response {
|
|
2409
|
+
body?: NavtoItem[];
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* Arguments for change request message.
|
|
2413
|
+
*/
|
|
2414
|
+
export interface ChangeRequestArgs extends FormatRequestArgs {
|
|
2415
|
+
/**
|
|
2416
|
+
* Optional string to insert at location (file, line, offset).
|
|
2417
|
+
*/
|
|
2418
|
+
insertString?: string;
|
|
2419
|
+
}
|
|
2420
|
+
/**
|
|
2421
|
+
* Change request message; value of command field is "change".
|
|
2422
|
+
* Update the server's view of the file named by argument 'file'.
|
|
2423
|
+
* Server does not currently send a response to a change request.
|
|
2424
|
+
*/
|
|
2425
|
+
export interface ChangeRequest extends FileLocationRequest {
|
|
2426
|
+
command: CommandTypes.Change;
|
|
2427
|
+
arguments: ChangeRequestArgs;
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Response to "brace" request.
|
|
2431
|
+
*/
|
|
2432
|
+
export interface BraceResponse extends Response {
|
|
2433
|
+
body?: TextSpan[];
|
|
2434
|
+
}
|
|
2435
|
+
/**
|
|
2436
|
+
* Brace matching request; value of command field is "brace".
|
|
2437
|
+
* Return response giving the file locations of matching braces
|
|
2438
|
+
* found in file at location line, offset.
|
|
2439
|
+
*/
|
|
2440
|
+
export interface BraceRequest extends FileLocationRequest {
|
|
2441
|
+
command: CommandTypes.Brace;
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* NavBar items request; value of command field is "navbar".
|
|
2445
|
+
* Return response giving the list of navigation bar entries
|
|
2446
|
+
* extracted from the requested file.
|
|
2447
|
+
*/
|
|
2448
|
+
export interface NavBarRequest extends FileRequest {
|
|
2449
|
+
command: CommandTypes.NavBar;
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* NavTree request; value of command field is "navtree".
|
|
2453
|
+
* Return response giving the navigation tree of the requested file.
|
|
2454
|
+
*/
|
|
2455
|
+
export interface NavTreeRequest extends FileRequest {
|
|
2456
|
+
command: CommandTypes.NavTree;
|
|
2457
|
+
}
|
|
2458
|
+
export interface NavigationBarItem {
|
|
2459
|
+
/**
|
|
2460
|
+
* The item's display text.
|
|
2461
|
+
*/
|
|
2462
|
+
text: string;
|
|
2463
|
+
/**
|
|
2464
|
+
* The symbol's kind (such as 'className' or 'parameterName').
|
|
2465
|
+
*/
|
|
2466
|
+
kind: ScriptElementKind;
|
|
2467
|
+
/**
|
|
2468
|
+
* Optional modifiers for the kind (such as 'public').
|
|
2469
|
+
*/
|
|
2470
|
+
kindModifiers?: string;
|
|
2471
|
+
/**
|
|
2472
|
+
* The definition locations of the item.
|
|
2473
|
+
*/
|
|
2474
|
+
spans: TextSpan[];
|
|
2475
|
+
/**
|
|
2476
|
+
* Optional children.
|
|
2477
|
+
*/
|
|
2478
|
+
childItems?: NavigationBarItem[];
|
|
2479
|
+
/**
|
|
2480
|
+
* Number of levels deep this item should appear.
|
|
2481
|
+
*/
|
|
2482
|
+
indent: number;
|
|
2483
|
+
}
|
|
2484
|
+
/** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
|
|
2485
|
+
export interface NavigationTree {
|
|
2486
|
+
text: string;
|
|
2487
|
+
kind: ScriptElementKind;
|
|
2488
|
+
kindModifiers: string;
|
|
2489
|
+
spans: TextSpan[];
|
|
2490
|
+
nameSpan: TextSpan | undefined;
|
|
2491
|
+
childItems?: NavigationTree[];
|
|
2492
|
+
}
|
|
2493
|
+
type TelemetryEventName = "telemetry";
|
|
2494
|
+
export interface TelemetryEvent extends Event {
|
|
2495
|
+
event: TelemetryEventName;
|
|
2496
|
+
body: TelemetryEventBody;
|
|
2497
|
+
}
|
|
2498
|
+
export interface TelemetryEventBody {
|
|
2499
|
+
telemetryEventName: string;
|
|
2500
|
+
payload: any;
|
|
2501
|
+
}
|
|
2502
|
+
type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
|
|
2503
|
+
export interface TypesInstallerInitializationFailedEvent extends Event {
|
|
2504
|
+
event: TypesInstallerInitializationFailedEventName;
|
|
2505
|
+
body: TypesInstallerInitializationFailedEventBody;
|
|
2506
|
+
}
|
|
2507
|
+
export interface TypesInstallerInitializationFailedEventBody {
|
|
2508
|
+
message: string;
|
|
2509
|
+
}
|
|
2510
|
+
type TypingsInstalledTelemetryEventName = "typingsInstalled";
|
|
2511
|
+
export interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
|
|
2512
|
+
telemetryEventName: TypingsInstalledTelemetryEventName;
|
|
2513
|
+
payload: TypingsInstalledTelemetryEventPayload;
|
|
2514
|
+
}
|
|
2515
|
+
export interface TypingsInstalledTelemetryEventPayload {
|
|
2516
|
+
/**
|
|
2517
|
+
* Comma separated list of installed typing packages
|
|
2518
|
+
*/
|
|
2519
|
+
installedPackages: string;
|
|
2520
|
+
/**
|
|
2521
|
+
* true if install request succeeded, otherwise - false
|
|
2522
|
+
*/
|
|
2523
|
+
installSuccess: boolean;
|
|
2524
|
+
/**
|
|
2525
|
+
* version of typings installer
|
|
2526
|
+
*/
|
|
2527
|
+
typingsInstallerVersion: string;
|
|
2528
|
+
}
|
|
2529
|
+
type BeginInstallTypesEventName = "beginInstallTypes";
|
|
2530
|
+
type EndInstallTypesEventName = "endInstallTypes";
|
|
2531
|
+
export interface BeginInstallTypesEvent extends Event {
|
|
2532
|
+
event: BeginInstallTypesEventName;
|
|
2533
|
+
body: BeginInstallTypesEventBody;
|
|
2534
|
+
}
|
|
2535
|
+
export interface EndInstallTypesEvent extends Event {
|
|
2536
|
+
event: EndInstallTypesEventName;
|
|
2537
|
+
body: EndInstallTypesEventBody;
|
|
2538
|
+
}
|
|
2539
|
+
export interface InstallTypesEventBody {
|
|
2540
|
+
/**
|
|
2541
|
+
* correlation id to match begin and end events
|
|
2542
|
+
*/
|
|
2543
|
+
eventId: number;
|
|
2544
|
+
/**
|
|
2545
|
+
* list of packages to install
|
|
2546
|
+
*/
|
|
2547
|
+
packages: readonly string[];
|
|
2548
|
+
}
|
|
2549
|
+
export interface BeginInstallTypesEventBody extends InstallTypesEventBody {
|
|
2550
|
+
}
|
|
2551
|
+
export interface EndInstallTypesEventBody extends InstallTypesEventBody {
|
|
2552
|
+
/**
|
|
2553
|
+
* true if installation succeeded, otherwise false
|
|
2554
|
+
*/
|
|
2555
|
+
success: boolean;
|
|
2556
|
+
}
|
|
2557
|
+
export interface NavBarResponse extends Response {
|
|
2558
|
+
body?: NavigationBarItem[];
|
|
2559
|
+
}
|
|
2560
|
+
export interface NavTreeResponse extends Response {
|
|
2561
|
+
body?: NavigationTree;
|
|
2562
|
+
}
|
|
2563
|
+
export interface CallHierarchyItem {
|
|
2564
|
+
name: string;
|
|
2565
|
+
kind: ScriptElementKind;
|
|
2566
|
+
kindModifiers?: string;
|
|
2567
|
+
file: string;
|
|
2568
|
+
span: TextSpan;
|
|
2569
|
+
selectionSpan: TextSpan;
|
|
2570
|
+
containerName?: string;
|
|
2571
|
+
}
|
|
2572
|
+
export interface CallHierarchyIncomingCall {
|
|
2573
|
+
from: CallHierarchyItem;
|
|
2574
|
+
fromSpans: TextSpan[];
|
|
2575
|
+
}
|
|
2576
|
+
export interface CallHierarchyOutgoingCall {
|
|
2577
|
+
to: CallHierarchyItem;
|
|
2578
|
+
fromSpans: TextSpan[];
|
|
2579
|
+
}
|
|
2580
|
+
export interface PrepareCallHierarchyRequest extends FileLocationRequest {
|
|
2581
|
+
command: CommandTypes.PrepareCallHierarchy;
|
|
2582
|
+
}
|
|
2583
|
+
export interface PrepareCallHierarchyResponse extends Response {
|
|
2584
|
+
readonly body: CallHierarchyItem | CallHierarchyItem[];
|
|
2585
|
+
}
|
|
2586
|
+
export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
|
|
2587
|
+
command: CommandTypes.ProvideCallHierarchyIncomingCalls;
|
|
2588
|
+
}
|
|
2589
|
+
export interface ProvideCallHierarchyIncomingCallsResponse extends Response {
|
|
2590
|
+
readonly body: CallHierarchyIncomingCall[];
|
|
2591
|
+
}
|
|
2592
|
+
export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
|
|
2593
|
+
command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
|
|
2594
|
+
}
|
|
2595
|
+
export interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
|
|
2596
|
+
readonly body: CallHierarchyOutgoingCall[];
|
|
2597
|
+
}
|
|
2598
|
+
const enum IndentStyle {
|
|
2599
|
+
None = "None",
|
|
2600
|
+
Block = "Block",
|
|
2601
|
+
Smart = "Smart"
|
|
2602
|
+
}
|
|
2603
|
+
enum SemicolonPreference {
|
|
2604
|
+
Ignore = "ignore",
|
|
2605
|
+
Insert = "insert",
|
|
2606
|
+
Remove = "remove"
|
|
2607
|
+
}
|
|
2608
|
+
export interface EditorSettings {
|
|
2609
|
+
baseIndentSize?: number;
|
|
2610
|
+
indentSize?: number;
|
|
2611
|
+
tabSize?: number;
|
|
2612
|
+
newLineCharacter?: string;
|
|
2613
|
+
convertTabsToSpaces?: boolean;
|
|
2614
|
+
indentStyle?: IndentStyle | ts.IndentStyle;
|
|
2615
|
+
trimTrailingWhitespace?: boolean;
|
|
2616
|
+
}
|
|
2617
|
+
export interface FormatCodeSettings extends EditorSettings {
|
|
2618
|
+
insertSpaceAfterCommaDelimiter?: boolean;
|
|
2619
|
+
insertSpaceAfterSemicolonInForStatements?: boolean;
|
|
2620
|
+
insertSpaceBeforeAndAfterBinaryOperators?: boolean;
|
|
2621
|
+
insertSpaceAfterConstructor?: boolean;
|
|
2622
|
+
insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
|
|
2623
|
+
insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
|
|
2624
|
+
insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
|
|
2625
|
+
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
|
|
2626
|
+
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
|
|
2627
|
+
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
|
|
2628
|
+
insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
|
|
2629
|
+
insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
|
|
2630
|
+
insertSpaceAfterTypeAssertion?: boolean;
|
|
2631
|
+
insertSpaceBeforeFunctionParenthesis?: boolean;
|
|
2632
|
+
placeOpenBraceOnNewLineForFunctions?: boolean;
|
|
2633
|
+
placeOpenBraceOnNewLineForControlBlocks?: boolean;
|
|
2634
|
+
insertSpaceBeforeTypeAnnotation?: boolean;
|
|
2635
|
+
semicolons?: SemicolonPreference;
|
|
2636
|
+
}
|
|
2637
|
+
export interface UserPreferences {
|
|
2638
|
+
readonly disableSuggestions?: boolean;
|
|
2639
|
+
readonly quotePreference?: "auto" | "double" | "single";
|
|
2640
|
+
/**
|
|
2641
|
+
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
|
|
2642
|
+
* This affects lone identifier completions but not completions on the right hand side of `obj.`.
|
|
2643
|
+
*/
|
|
2644
|
+
readonly includeCompletionsForModuleExports?: boolean;
|
|
2645
|
+
/**
|
|
2646
|
+
* Enables auto-import-style completions on partially-typed import statements. E.g., allows
|
|
2647
|
+
* `import write|` to be completed to `import { writeFile } from "fs"`.
|
|
2648
|
+
*/
|
|
2649
|
+
readonly includeCompletionsForImportStatements?: boolean;
|
|
2650
|
+
/**
|
|
2651
|
+
* Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
|
|
2652
|
+
*/
|
|
2653
|
+
readonly includeCompletionsWithSnippetText?: boolean;
|
|
2654
|
+
/**
|
|
2655
|
+
* If enabled, the completion list will include completions with invalid identifier names.
|
|
2656
|
+
* For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
|
|
2657
|
+
*/
|
|
2658
|
+
readonly includeCompletionsWithInsertText?: boolean;
|
|
2659
|
+
/**
|
|
2660
|
+
* Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
|
|
2661
|
+
* member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
|
|
2662
|
+
* values, with insertion text to replace preceding `.` tokens with `?.`.
|
|
2663
|
+
*/
|
|
2664
|
+
readonly includeAutomaticOptionalChainCompletions?: boolean;
|
|
2665
|
+
/**
|
|
2666
|
+
* If enabled, completions for class members (e.g. methods and properties) will include
|
|
2667
|
+
* a whole declaration for the member.
|
|
2668
|
+
* E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
|
|
2669
|
+
* `class A { foo }`.
|
|
2670
|
+
*/
|
|
2671
|
+
readonly includeCompletionsWithClassMemberSnippets?: boolean;
|
|
2672
|
+
/**
|
|
2673
|
+
* If enabled, object literal methods will have a method declaration completion entry in addition
|
|
2674
|
+
* to the regular completion entry containing just the method name.
|
|
2675
|
+
* E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
|
|
2676
|
+
* in addition to `const objectLiteral: T = { foo }`.
|
|
2677
|
+
*/
|
|
2678
|
+
readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
|
|
2679
|
+
/**
|
|
2680
|
+
* Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
|
|
2681
|
+
* If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
|
|
2682
|
+
*/
|
|
2683
|
+
readonly useLabelDetailsInCompletionEntries?: boolean;
|
|
2684
|
+
readonly allowIncompleteCompletions?: boolean;
|
|
2685
|
+
readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
|
|
2686
|
+
/** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
|
|
2687
|
+
readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
|
|
2688
|
+
readonly allowTextChangesInNewFiles?: boolean;
|
|
2689
|
+
readonly lazyConfiguredProjectsFromExternalProject?: boolean;
|
|
2690
|
+
readonly providePrefixAndSuffixTextForRename?: boolean;
|
|
2691
|
+
readonly provideRefactorNotApplicableReason?: boolean;
|
|
2692
|
+
readonly allowRenameOfImportPath?: boolean;
|
|
2693
|
+
readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
|
|
2694
|
+
readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
|
|
2695
|
+
readonly displayPartsForJSDoc?: boolean;
|
|
2696
|
+
readonly generateReturnInDocTemplate?: boolean;
|
|
2697
|
+
readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
|
|
2698
|
+
readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
|
|
2699
|
+
readonly includeInlayFunctionParameterTypeHints?: boolean;
|
|
2700
|
+
readonly includeInlayVariableTypeHints?: boolean;
|
|
2701
|
+
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
|
2702
|
+
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
|
2703
|
+
readonly includeInlayEnumMemberValueHints?: boolean;
|
|
2704
|
+
}
|
|
2705
|
+
export interface CompilerOptions {
|
|
2706
|
+
allowJs?: boolean;
|
|
2707
|
+
allowSyntheticDefaultImports?: boolean;
|
|
2708
|
+
allowUnreachableCode?: boolean;
|
|
2709
|
+
allowUnusedLabels?: boolean;
|
|
2710
|
+
alwaysStrict?: boolean;
|
|
2711
|
+
baseUrl?: string;
|
|
2712
|
+
charset?: string;
|
|
2713
|
+
checkJs?: boolean;
|
|
2714
|
+
declaration?: boolean;
|
|
2715
|
+
declarationDir?: string;
|
|
2716
|
+
disableSizeLimit?: boolean;
|
|
2717
|
+
downlevelIteration?: boolean;
|
|
2718
|
+
emitBOM?: boolean;
|
|
2719
|
+
emitDecoratorMetadata?: boolean;
|
|
2720
|
+
experimentalDecorators?: boolean;
|
|
2721
|
+
forceConsistentCasingInFileNames?: boolean;
|
|
2722
|
+
importHelpers?: boolean;
|
|
2723
|
+
inlineSourceMap?: boolean;
|
|
2724
|
+
inlineSources?: boolean;
|
|
2725
|
+
isolatedModules?: boolean;
|
|
2726
|
+
jsx?: JsxEmit | ts.JsxEmit;
|
|
2727
|
+
lib?: string[];
|
|
2728
|
+
locale?: string;
|
|
2729
|
+
mapRoot?: string;
|
|
2730
|
+
maxNodeModuleJsDepth?: number;
|
|
2731
|
+
module?: ModuleKind | ts.ModuleKind;
|
|
2732
|
+
moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
|
|
2733
|
+
newLine?: NewLineKind | ts.NewLineKind;
|
|
2734
|
+
noEmit?: boolean;
|
|
2735
|
+
noEmitHelpers?: boolean;
|
|
2736
|
+
noEmitOnError?: boolean;
|
|
2737
|
+
noErrorTruncation?: boolean;
|
|
2738
|
+
noFallthroughCasesInSwitch?: boolean;
|
|
2739
|
+
noImplicitAny?: boolean;
|
|
2740
|
+
noImplicitReturns?: boolean;
|
|
2741
|
+
noImplicitThis?: boolean;
|
|
2742
|
+
noUnusedLocals?: boolean;
|
|
2743
|
+
noUnusedParameters?: boolean;
|
|
2744
|
+
noImplicitUseStrict?: boolean;
|
|
2745
|
+
noLib?: boolean;
|
|
2746
|
+
noResolve?: boolean;
|
|
2747
|
+
out?: string;
|
|
2748
|
+
outDir?: string;
|
|
2749
|
+
outFile?: string;
|
|
2750
|
+
paths?: MapLike<string[]>;
|
|
2751
|
+
plugins?: PluginImport[];
|
|
2752
|
+
preserveConstEnums?: boolean;
|
|
2753
|
+
preserveSymlinks?: boolean;
|
|
2754
|
+
project?: string;
|
|
2755
|
+
reactNamespace?: string;
|
|
2756
|
+
removeComments?: boolean;
|
|
2757
|
+
references?: ProjectReference[];
|
|
2758
|
+
rootDir?: string;
|
|
2759
|
+
rootDirs?: string[];
|
|
2760
|
+
skipLibCheck?: boolean;
|
|
2761
|
+
skipDefaultLibCheck?: boolean;
|
|
2762
|
+
sourceMap?: boolean;
|
|
2763
|
+
sourceRoot?: string;
|
|
2764
|
+
strict?: boolean;
|
|
2765
|
+
strictNullChecks?: boolean;
|
|
2766
|
+
suppressExcessPropertyErrors?: boolean;
|
|
2767
|
+
suppressImplicitAnyIndexErrors?: boolean;
|
|
2768
|
+
useDefineForClassFields?: boolean;
|
|
2769
|
+
target?: ScriptTarget | ts.ScriptTarget;
|
|
2770
|
+
traceResolution?: boolean;
|
|
2771
|
+
resolveJsonModule?: boolean;
|
|
2772
|
+
types?: string[];
|
|
2773
|
+
/** Paths used to used to compute primary types search locations */
|
|
2774
|
+
typeRoots?: string[];
|
|
2775
|
+
[option: string]: CompilerOptionsValue | undefined;
|
|
2776
|
+
}
|
|
2777
|
+
const enum JsxEmit {
|
|
2778
|
+
None = "None",
|
|
2779
|
+
Preserve = "Preserve",
|
|
2780
|
+
ReactNative = "ReactNative",
|
|
2781
|
+
React = "React"
|
|
2782
|
+
}
|
|
2783
|
+
const enum ModuleKind {
|
|
2784
|
+
None = "None",
|
|
2785
|
+
CommonJS = "CommonJS",
|
|
2786
|
+
AMD = "AMD",
|
|
2787
|
+
UMD = "UMD",
|
|
2788
|
+
System = "System",
|
|
2789
|
+
ES6 = "ES6",
|
|
2790
|
+
ES2015 = "ES2015",
|
|
2791
|
+
ESNext = "ESNext"
|
|
2792
|
+
}
|
|
2793
|
+
const enum ModuleResolutionKind {
|
|
2794
|
+
Classic = "Classic",
|
|
2795
|
+
Node = "Node"
|
|
2796
|
+
}
|
|
2797
|
+
const enum NewLineKind {
|
|
2798
|
+
Crlf = "Crlf",
|
|
2799
|
+
Lf = "Lf"
|
|
2800
|
+
}
|
|
2801
|
+
const enum ScriptTarget {
|
|
2802
|
+
ES3 = "ES3",
|
|
2803
|
+
ES5 = "ES5",
|
|
2804
|
+
ES6 = "ES6",
|
|
2805
|
+
ES2015 = "ES2015",
|
|
2806
|
+
ES2016 = "ES2016",
|
|
2807
|
+
ES2017 = "ES2017",
|
|
2808
|
+
ES2018 = "ES2018",
|
|
2809
|
+
ES2019 = "ES2019",
|
|
2810
|
+
ES2020 = "ES2020",
|
|
2811
|
+
ES2021 = "ES2021",
|
|
2812
|
+
ES2022 = "ES2022",
|
|
2813
|
+
ESNext = "ESNext"
|
|
2814
|
+
}
|
|
2815
|
+
export interface TextInsertion {
|
|
2816
|
+
newText: string;
|
|
2817
|
+
/** The position in newText the caret should point to after the insertion. */
|
|
2818
|
+
caretOffset: number;
|
|
2819
|
+
}
|
|
2820
|
+
export interface TodoCommentDescriptor {
|
|
2821
|
+
text: string;
|
|
2822
|
+
priority: number;
|
|
2823
|
+
}
|
|
2824
|
+
export interface TodoComment {
|
|
2825
|
+
descriptor: TodoCommentDescriptor;
|
|
2826
|
+
message: string;
|
|
2827
|
+
position: number;
|
|
2828
|
+
}
|
|
2829
|
+
enum OutliningSpanKind {
|
|
2830
|
+
/** Single or multi-line comments */
|
|
2831
|
+
Comment = "comment",
|
|
2832
|
+
/** Sections marked by '// #region' and '// #endregion' comments */
|
|
2833
|
+
Region = "region",
|
|
2834
|
+
/** Declarations and expressions */
|
|
2835
|
+
Code = "code",
|
|
2836
|
+
/** Contiguous blocks of import declarations */
|
|
2837
|
+
Imports = "imports"
|
|
2838
|
+
}
|
|
2839
|
+
enum HighlightSpanKind {
|
|
2840
|
+
none = "none",
|
|
2841
|
+
definition = "definition",
|
|
2842
|
+
reference = "reference",
|
|
2843
|
+
writtenReference = "writtenReference"
|
|
2844
|
+
}
|
|
2845
|
+
enum ScriptElementKind {
|
|
2846
|
+
unknown = "",
|
|
2847
|
+
warning = "warning",
|
|
2848
|
+
/** predefined type (void) or keyword (class) */
|
|
2849
|
+
keyword = "keyword",
|
|
2850
|
+
/** top level script node */
|
|
2851
|
+
scriptElement = "script",
|
|
2852
|
+
/** module foo {} */
|
|
2853
|
+
moduleElement = "module",
|
|
2854
|
+
/** class X {} */
|
|
2855
|
+
classElement = "class",
|
|
2856
|
+
/** var x = class X {} */
|
|
2857
|
+
localClassElement = "local class",
|
|
2858
|
+
/** interface Y {} */
|
|
2859
|
+
interfaceElement = "interface",
|
|
2860
|
+
/** type T = ... */
|
|
2861
|
+
typeElement = "type",
|
|
2862
|
+
/** enum E */
|
|
2863
|
+
enumElement = "enum",
|
|
2864
|
+
enumMemberElement = "enum member",
|
|
2865
|
+
/**
|
|
2866
|
+
* Inside module and script only
|
|
2867
|
+
* const v = ..
|
|
2868
|
+
*/
|
|
2869
|
+
variableElement = "var",
|
|
2870
|
+
/** Inside function */
|
|
2871
|
+
localVariableElement = "local var",
|
|
2872
|
+
/**
|
|
2873
|
+
* Inside module and script only
|
|
2874
|
+
* function f() { }
|
|
2875
|
+
*/
|
|
2876
|
+
functionElement = "function",
|
|
2877
|
+
/** Inside function */
|
|
2878
|
+
localFunctionElement = "local function",
|
|
2879
|
+
/** class X { [public|private]* foo() {} } */
|
|
2880
|
+
memberFunctionElement = "method",
|
|
2881
|
+
/** class X { [public|private]* [get|set] foo:number; } */
|
|
2882
|
+
memberGetAccessorElement = "getter",
|
|
2883
|
+
memberSetAccessorElement = "setter",
|
|
2884
|
+
/**
|
|
2885
|
+
* class X { [public|private]* foo:number; }
|
|
2886
|
+
* interface Y { foo:number; }
|
|
2887
|
+
*/
|
|
2888
|
+
memberVariableElement = "property",
|
|
2889
|
+
/**
|
|
2890
|
+
* class X { constructor() { } }
|
|
2891
|
+
* class X { static { } }
|
|
2892
|
+
*/
|
|
2893
|
+
constructorImplementationElement = "constructor",
|
|
2894
|
+
/** interface Y { ():number; } */
|
|
2895
|
+
callSignatureElement = "call",
|
|
2896
|
+
/** interface Y { []:number; } */
|
|
2897
|
+
indexSignatureElement = "index",
|
|
2898
|
+
/** interface Y { new():Y; } */
|
|
2899
|
+
constructSignatureElement = "construct",
|
|
2900
|
+
/** function foo(*Y*: string) */
|
|
2901
|
+
parameterElement = "parameter",
|
|
2902
|
+
typeParameterElement = "type parameter",
|
|
2903
|
+
primitiveType = "primitive type",
|
|
2904
|
+
label = "label",
|
|
2905
|
+
alias = "alias",
|
|
2906
|
+
constElement = "const",
|
|
2907
|
+
letElement = "let",
|
|
2908
|
+
directory = "directory",
|
|
2909
|
+
externalModuleName = "external module name",
|
|
2910
|
+
/**
|
|
2911
|
+
* <JsxTagName attribute1 attribute2={0} />
|
|
2912
|
+
* @deprecated
|
|
2913
|
+
*/
|
|
2914
|
+
jsxAttribute = "JSX attribute",
|
|
2915
|
+
/** String literal */
|
|
2916
|
+
string = "string",
|
|
2917
|
+
/** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */
|
|
2918
|
+
link = "link",
|
|
2919
|
+
/** Jsdoc @link: in `{@link C link text}`, the entity name "C" */
|
|
2920
|
+
linkName = "link name",
|
|
2921
|
+
/** Jsdoc @link: in `{@link C link text}`, the link text "link text" */
|
|
2922
|
+
linkText = "link text"
|
|
2923
|
+
}
|
|
2924
|
+
export interface TypeAcquisition {
|
|
2925
|
+
/**
|
|
2926
|
+
* @deprecated typingOptions.enableAutoDiscovery
|
|
2927
|
+
* Use typeAcquisition.enable instead.
|
|
2928
|
+
*/
|
|
2929
|
+
enableAutoDiscovery?: boolean;
|
|
2930
|
+
enable?: boolean;
|
|
2931
|
+
include?: string[];
|
|
2932
|
+
exclude?: string[];
|
|
2933
|
+
disableFilenameBasedTypeAcquisition?: boolean;
|
|
2934
|
+
[option: string]: CompilerOptionsValue | undefined;
|
|
2935
|
+
}
|
|
2936
|
+
export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
|
|
2937
|
+
export interface FileExtensionInfo {
|
|
2938
|
+
extension: string;
|
|
2939
|
+
isMixedContent: boolean;
|
|
2940
|
+
scriptKind?: ScriptKind;
|
|
2941
|
+
}
|
|
2942
|
+
/**
|
|
2943
|
+
* Type of objects whose values are all of the same type.
|
|
2944
|
+
* The `in` and `for-in` operators can *not* be safely used,
|
|
2945
|
+
* since `Object.prototype` may be modified by outside code.
|
|
2946
|
+
*/
|
|
2947
|
+
export interface MapLike<T> {
|
|
2948
|
+
[index: string]: T;
|
|
2949
|
+
}
|
|
2950
|
+
export interface PluginImport {
|
|
2951
|
+
name: string;
|
|
2952
|
+
}
|
|
2953
|
+
export interface ProjectReference {
|
|
2954
|
+
/** A normalized path on disk */
|
|
2955
|
+
path: string;
|
|
2956
|
+
/** The path as the user originally wrote it */
|
|
2957
|
+
originalPath?: string;
|
|
2958
|
+
/** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
|
|
2959
|
+
prepend?: boolean;
|
|
2960
|
+
/** True if it is intended that this reference form a circularity */
|
|
2961
|
+
circular?: boolean;
|
|
2962
|
+
}
|
|
2963
|
+
export {};
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
type EndOfLineState = never;
|
|
2967
|
+
type ScriptKind = never;
|
|
2968
|
+
type WatchFileKind = never;
|
|
2969
|
+
type WatchDirectoryKind = never;
|
|
2970
|
+
type PollingWatchKind = never;
|
|
2971
|
+
type IndentStyle = never;
|
|
2972
|
+
type JsxEmit = never;
|
|
2973
|
+
type ModuleKind = never;
|
|
2974
|
+
type ModuleResolutionKind = never;
|
|
2975
|
+
type NewLineKind = never;
|
|
2976
|
+
type ScriptTarget = never;
|
|
2977
|
+
}
|
|
2978
|
+
import tsProtocol = ts.server.protocol;
|
|
2979
|
+
export { tsProtocol };
|
|
2980
|
+
//# sourceMappingURL=protocol.d.ts.map
|