1 | import { CancellationToken, ProtocolRequestType0, RequestHandler0, ProtocolRequestType, RequestHandler, GenericRequestHandler, StarRequestHandler, HandlerResult, ProtocolNotificationType0, NotificationHandler0, ProtocolNotificationType, NotificationHandler, GenericNotificationHandler, StarNotificationHandler, ProgressType, Disposable, InitializeParams, InitializeResult, InitializeError, InitializedParams, DidChangeConfigurationParams, DidChangeWatchedFilesParams, DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, WillSaveTextDocumentParams, TextEdit, DidSaveTextDocumentParams, PublishDiagnosticsParams, HoverParams, Hover, CompletionParams, CompletionItem, CompletionList, SignatureHelpParams, SignatureHelp, DeclarationParams, Declaration, DeclarationLink, Location, DefinitionParams, Definition, DefinitionLink, TypeDefinitionParams, ImplementationParams, ReferenceParams, DocumentHighlightParams, DocumentHighlight, DocumentSymbolParams, SymbolInformation, DocumentSymbol, WorkspaceSymbolParams, CodeActionParams, Command, CodeAction, CodeLensParams, CodeLens, DocumentFormattingParams, DocumentRangeFormattingParams, DocumentOnTypeFormattingParams, RenameParams, WorkspaceEdit, PrepareRenameParams, Range, DocumentLinkParams, DocumentLink, DocumentColorParams, ColorInformation, ColorPresentationParams, ColorPresentation, FoldingRangeParams, FoldingRange, SelectionRangeParams, SelectionRange, ExecuteCommandParams, MessageActionItem, ClientCapabilities, ServerCapabilities, Logger, ProtocolConnection, MessageSignature, ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, WorkDoneProgressParams, PartialResultParams, RegistrationType, RequestType0, RequestType, NotificationType0, NotificationType, WorkspaceSymbol } from 'vscode-languageserver-protocol';
|
2 | import { WorkDoneProgressReporter, ResultProgressReporter, WindowProgress } from './progress';
|
3 | import { Configuration } from './configuration';
|
4 | import { WorkspaceFolders } from './workspaceFolder';
|
5 | import { CallHierarchy } from './callHierarchy';
|
6 | import { SemanticTokensFeatureShape } from './semanticTokens';
|
7 | import { ShowDocumentFeatureShape } from './showDocument';
|
8 | import { FileOperationsFeatureShape } from './fileOperations';
|
9 | import { LinkedEditingRangeFeatureShape } from './linkedEditingRange';
|
10 | import { TypeHierarchyFeatureShape } from './typeHierarchy';
|
11 | import { InlineValueFeatureShape } from './inlineValue';
|
12 | import { FoldingRangeFeatureShape } from './foldingRange';
|
13 | import { InlayHintFeatureShape } from './inlayHint';
|
14 | import { DiagnosticFeatureShape } from './diagnostic';
|
15 | import { NotebookSyncFeatureShape } from './notebook';
|
16 | import { MonikerFeatureShape } from './moniker';
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | export declare class ErrorMessageTracker {
|
24 | private _messages;
|
25 | constructor();
|
26 | /**
|
27 | * Add a message to the tracker.
|
28 | *
|
29 | * @param message The message to add.
|
30 | */
|
31 | add(message: string): void;
|
32 | /**
|
33 | * Send all tracked messages to the connection's window.
|
34 | *
|
35 | * @param connection The connection established between client and server.
|
36 | */
|
37 | sendErrors(connection: {
|
38 | window: RemoteWindow;
|
39 | }): void;
|
40 | }
|
41 | export interface FeatureBase {
|
42 | |
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | initialize(capabilities: ClientCapabilities): void;
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 | fillServerCapabilities(capabilities: ServerCapabilities): void;
|
55 | }
|
56 | interface Remote extends FeatureBase {
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 | attach(connection: Connection): void;
|
63 | |
64 |
|
65 |
|
66 | connection: Connection;
|
67 | }
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | export interface RemoteConsole extends FeatureBase {
|
74 | |
75 |
|
76 |
|
77 | connection: Connection;
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 | error(message: string): void;
|
84 | |
85 |
|
86 |
|
87 |
|
88 |
|
89 | warn(message: string): void;
|
90 | |
91 |
|
92 |
|
93 |
|
94 |
|
95 | info(message: string): void;
|
96 | |
97 |
|
98 |
|
99 |
|
100 |
|
101 | log(message: string): void;
|
102 | |
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | debug(message: string): void;
|
110 | }
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | export interface _RemoteWindow extends FeatureBase {
|
116 | |
117 |
|
118 |
|
119 | connection: Connection;
|
120 | |
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 | showErrorMessage(message: string): void;
|
129 | showErrorMessage<T extends MessageActionItem>(message: string, ...actions: T[]): Promise<T | undefined>;
|
130 | |
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | showWarningMessage(message: string): void;
|
139 | showWarningMessage<T extends MessageActionItem>(message: string, ...actions: T[]): Promise<T | undefined>;
|
140 | |
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | showInformationMessage(message: string): void;
|
149 | showInformationMessage<T extends MessageActionItem>(message: string, ...actions: T[]): Promise<T | undefined>;
|
150 | }
|
151 | export type RemoteWindow = _RemoteWindow & WindowProgress & ShowDocumentFeatureShape;
|
152 |
|
153 |
|
154 |
|
155 |
|
156 | export interface BulkRegistration {
|
157 | |
158 |
|
159 |
|
160 |
|
161 |
|
162 | add<RO>(type: ProtocolNotificationType0<RO>, registerParams: RO): void;
|
163 | add<P, RO>(type: ProtocolNotificationType<P, RO>, registerParams: RO): void;
|
164 | |
165 |
|
166 |
|
167 |
|
168 |
|
169 | add<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, registerParams: RO): void;
|
170 | add<P, PR, R, E, RO>(type: ProtocolRequestType<P, PR, R, E, RO>, registerParams: RO): void;
|
171 | |
172 |
|
173 |
|
174 |
|
175 |
|
176 | add<RO>(type: RegistrationType<RO>, registerParams: RO): void;
|
177 | }
|
178 | export declare namespace BulkRegistration {
|
179 | |
180 |
|
181 |
|
182 |
|
183 | function create(): BulkRegistration;
|
184 | }
|
185 |
|
186 |
|
187 |
|
188 | export interface BulkUnregistration extends Disposable {
|
189 | |
190 |
|
191 |
|
192 |
|
193 | disposeSingle(arg: string | MessageSignature): boolean;
|
194 | }
|
195 | export declare namespace BulkUnregistration {
|
196 | function create(): BulkUnregistration;
|
197 | }
|
198 |
|
199 |
|
200 |
|
201 | export interface RemoteClient extends FeatureBase {
|
202 | |
203 |
|
204 |
|
205 | connection: Connection;
|
206 | |
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 | register<P, RO>(type: ProtocolNotificationType<P, RO>, registerParams?: RO): Promise<Disposable>;
|
214 | register<RO>(type: ProtocolNotificationType0<RO>, registerParams?: RO): Promise<Disposable>;
|
215 | |
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 | register<P, RO>(unregisteration: BulkUnregistration, type: ProtocolNotificationType<P, RO>, registerParams?: RO): Promise<Disposable>;
|
224 | register<RO>(unregisteration: BulkUnregistration, type: ProtocolNotificationType0<RO>, registerParams?: RO): Promise<Disposable>;
|
225 | |
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 | register<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
|
233 | register<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
|
234 | |
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 | register<P, R, PR, E, RO>(unregisteration: BulkUnregistration, type: ProtocolRequestType<P, R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
|
243 | register<R, PR, E, RO>(unregisteration: BulkUnregistration, type: ProtocolRequestType0<R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
|
244 | |
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 | register<RO>(type: RegistrationType<RO>, registerParams?: RO): Promise<Disposable>;
|
252 | |
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 | register<RO>(unregisteration: BulkUnregistration, type: RegistrationType<RO>, registerParams?: RO): Promise<Disposable>;
|
261 | |
262 |
|
263 |
|
264 |
|
265 |
|
266 | register(registrations: BulkRegistration): Promise<BulkUnregistration>;
|
267 | }
|
268 |
|
269 |
|
270 |
|
271 | export interface _RemoteWorkspace extends FeatureBase {
|
272 | |
273 |
|
274 |
|
275 | connection: Connection;
|
276 | |
277 |
|
278 |
|
279 |
|
280 |
|
281 | applyEdit(paramOrEdit: ApplyWorkspaceEditParams | WorkspaceEdit): Promise<ApplyWorkspaceEditResponse>;
|
282 | }
|
283 | export type RemoteWorkspace = _RemoteWorkspace & Configuration & WorkspaceFolders & FileOperationsFeatureShape;
|
284 |
|
285 |
|
286 |
|
287 |
|
288 | export interface Telemetry extends FeatureBase {
|
289 | |
290 |
|
291 |
|
292 | connection: Connection;
|
293 | |
294 |
|
295 |
|
296 |
|
297 |
|
298 | logEvent(data: any): void;
|
299 | }
|
300 |
|
301 |
|
302 |
|
303 |
|
304 | export interface RemoteTracer extends FeatureBase {
|
305 | |
306 |
|
307 |
|
308 | connection: Connection;
|
309 | |
310 |
|
311 |
|
312 | log(message: string, verbose?: string): void;
|
313 | }
|
314 | export interface _Languages extends FeatureBase {
|
315 | connection: Connection;
|
316 | attachWorkDoneProgress(params: WorkDoneProgressParams): WorkDoneProgressReporter;
|
317 | attachPartialResultProgress<PR>(type: ProgressType<PR>, params: PartialResultParams): ResultProgressReporter<PR> | undefined;
|
318 | }
|
319 | export declare class _LanguagesImpl implements Remote, _Languages {
|
320 | private _connection;
|
321 | constructor();
|
322 | attach(connection: Connection): void;
|
323 | get connection(): Connection;
|
324 | initialize(_capabilities: ClientCapabilities): void;
|
325 | fillServerCapabilities(_capabilities: ServerCapabilities): void;
|
326 | attachWorkDoneProgress(params: WorkDoneProgressParams): WorkDoneProgressReporter;
|
327 | attachPartialResultProgress<PR>(_type: ProgressType<PR>, params: PartialResultParams): ResultProgressReporter<PR> | undefined;
|
328 | }
|
329 | export type Languages = _Languages & CallHierarchy & SemanticTokensFeatureShape & LinkedEditingRangeFeatureShape & TypeHierarchyFeatureShape & InlineValueFeatureShape & InlayHintFeatureShape & DiagnosticFeatureShape & MonikerFeatureShape & FoldingRangeFeatureShape;
|
330 | export interface _Notebooks extends FeatureBase {
|
331 | connection: Connection;
|
332 | attachWorkDoneProgress(params: WorkDoneProgressParams): WorkDoneProgressReporter;
|
333 | attachPartialResultProgress<PR>(type: ProgressType<PR>, params: PartialResultParams): ResultProgressReporter<PR> | undefined;
|
334 | }
|
335 | export declare class _NotebooksImpl implements Remote, _Notebooks {
|
336 | private _connection;
|
337 | constructor();
|
338 | attach(connection: Connection): void;
|
339 | get connection(): Connection;
|
340 | initialize(_capabilities: ClientCapabilities): void;
|
341 | fillServerCapabilities(_capabilities: ServerCapabilities): void;
|
342 | attachWorkDoneProgress(params: WorkDoneProgressParams): WorkDoneProgressReporter;
|
343 | attachPartialResultProgress<PR>(_type: ProgressType<PR>, params: PartialResultParams): ResultProgressReporter<PR> | undefined;
|
344 | }
|
345 | export type Notebooks = _Notebooks & NotebookSyncFeatureShape;
|
346 | /**
|
347 | * An empty interface for new proposed API.
|
348 | */
|
349 | export interface _ {
|
350 | }
|
351 | export interface ServerRequestHandler<P, R, PR, E> {
|
352 | (params: P, token: CancellationToken, workDoneProgress: WorkDoneProgressReporter, resultProgress?: ResultProgressReporter<PR>): HandlerResult<R, E>;
|
353 | }
|
354 |
|
355 |
|
356 |
|
357 | export interface _Connection<PConsole = _, PTracer = _, PTelemetry = _, PClient = _, PWindow = _, PWorkspace = _, PLanguages = _, PNotebooks = _> {
|
358 | |
359 |
|
360 |
|
361 | listen(): void;
|
362 | |
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 | onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
|
369 | onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
|
370 | onRequest<R, PR, E, RO>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
|
371 | onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
|
372 | |
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 | onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable;
|
379 | |
380 |
|
381 |
|
382 |
|
383 |
|
384 | onRequest(handler: StarRequestHandler): Disposable;
|
385 | |
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 | sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
|
392 | sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;
|
393 | sendRequest<R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>;
|
394 | sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
|
395 | |
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 | sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;
|
402 | sendRequest<R>(method: string, params: any, token?: CancellationToken): Promise<R>;
|
403 | |
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 | onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
|
410 | onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
|
411 | onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
|
412 | onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
|
413 | |
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 | onNotification(method: string, handler: GenericNotificationHandler): Disposable;
|
420 | |
421 |
|
422 |
|
423 |
|
424 |
|
425 | onNotification(handler: StarNotificationHandler): Disposable;
|
426 | |
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 | sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
|
433 | sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params: P): Promise<void>;
|
434 | sendNotification(type: NotificationType0): Promise<void>;
|
435 | sendNotification<P>(type: NotificationType<P>, params: P): Promise<void>;
|
436 | |
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 | sendNotification(method: string, params?: any): Promise<void>;
|
443 | |
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 | onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
|
450 | |
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 | sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;
|
457 | |
458 |
|
459 |
|
460 |
|
461 |
|
462 | onInitialize(handler: ServerRequestHandler<InitializeParams, InitializeResult, never, InitializeError>): Disposable;
|
463 | |
464 |
|
465 |
|
466 |
|
467 |
|
468 | onInitialized(handler: NotificationHandler<InitializedParams>): Disposable;
|
469 | |
470 |
|
471 |
|
472 |
|
473 |
|
474 | onShutdown(handler: RequestHandler0<void, void>): Disposable;
|
475 | |
476 |
|
477 |
|
478 |
|
479 |
|
480 | onExit(handler: NotificationHandler0): Disposable;
|
481 | |
482 |
|
483 |
|
484 | console: RemoteConsole & PConsole;
|
485 | |
486 |
|
487 |
|
488 | tracer: RemoteTracer & PTracer;
|
489 | |
490 |
|
491 |
|
492 | telemetry: Telemetry & PTelemetry;
|
493 | |
494 |
|
495 |
|
496 |
|
497 | client: RemoteClient & PClient;
|
498 | |
499 |
|
500 |
|
501 | window: RemoteWindow & PWindow;
|
502 | |
503 |
|
504 |
|
505 | workspace: RemoteWorkspace & PWorkspace;
|
506 | |
507 |
|
508 |
|
509 | languages: Languages & PLanguages;
|
510 | |
511 |
|
512 |
|
513 | notebooks: Notebooks & PNotebooks;
|
514 | |
515 |
|
516 |
|
517 |
|
518 |
|
519 | onDidChangeConfiguration(handler: NotificationHandler<DidChangeConfigurationParams>): Disposable;
|
520 | |
521 |
|
522 |
|
523 |
|
524 |
|
525 | onDidChangeWatchedFiles(handler: NotificationHandler<DidChangeWatchedFilesParams>): Disposable;
|
526 | |
527 |
|
528 |
|
529 |
|
530 |
|
531 | onDidOpenTextDocument(handler: NotificationHandler<DidOpenTextDocumentParams>): Disposable;
|
532 | |
533 |
|
534 |
|
535 |
|
536 |
|
537 | onDidChangeTextDocument(handler: NotificationHandler<DidChangeTextDocumentParams>): Disposable;
|
538 | |
539 |
|
540 |
|
541 |
|
542 |
|
543 | onDidCloseTextDocument(handler: NotificationHandler<DidCloseTextDocumentParams>): Disposable;
|
544 | |
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 | onWillSaveTextDocument(handler: NotificationHandler<WillSaveTextDocumentParams>): Disposable;
|
554 | |
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 | onWillSaveTextDocumentWaitUntil(handler: RequestHandler<WillSaveTextDocumentParams, TextEdit[] | undefined | null, void>): Disposable;
|
565 | |
566 |
|
567 |
|
568 |
|
569 |
|
570 | onDidSaveTextDocument(handler: NotificationHandler<DidSaveTextDocumentParams>): Disposable;
|
571 | |
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 | sendDiagnostics(params: PublishDiagnosticsParams): Promise<void>;
|
578 | |
579 |
|
580 |
|
581 |
|
582 |
|
583 | onHover(handler: ServerRequestHandler<HoverParams, Hover | undefined | null, never, void>): Disposable;
|
584 | |
585 |
|
586 |
|
587 |
|
588 |
|
589 | onCompletion(handler: ServerRequestHandler<CompletionParams, CompletionItem[] | CompletionList | undefined | null, CompletionItem[], void>): Disposable;
|
590 | |
591 |
|
592 |
|
593 |
|
594 |
|
595 | onCompletionResolve(handler: RequestHandler<CompletionItem, CompletionItem, void>): Disposable;
|
596 | |
597 |
|
598 |
|
599 |
|
600 |
|
601 | onSignatureHelp(handler: ServerRequestHandler<SignatureHelpParams, SignatureHelp | undefined | null, never, void>): Disposable;
|
602 | |
603 |
|
604 |
|
605 |
|
606 |
|
607 | onDeclaration(handler: ServerRequestHandler<DeclarationParams, Declaration | DeclarationLink[] | undefined | null, Location[] | DeclarationLink[], void>): Disposable;
|
608 | |
609 |
|
610 |
|
611 |
|
612 |
|
613 | onDefinition(handler: ServerRequestHandler<DefinitionParams, Definition | DefinitionLink[] | undefined | null, Location[] | DefinitionLink[], void>): Disposable;
|
614 | |
615 |
|
616 |
|
617 |
|
618 |
|
619 | onTypeDefinition(handler: ServerRequestHandler<TypeDefinitionParams, Definition | DefinitionLink[] | undefined | null, Location[] | DefinitionLink[], void>): Disposable;
|
620 | |
621 |
|
622 |
|
623 |
|
624 |
|
625 | onImplementation(handler: ServerRequestHandler<ImplementationParams, Definition | DefinitionLink[] | undefined | null, Location[] | DefinitionLink[], void>): Disposable;
|
626 | |
627 |
|
628 |
|
629 |
|
630 |
|
631 | onReferences(handler: ServerRequestHandler<ReferenceParams, Location[] | undefined | null, Location[], void>): Disposable;
|
632 | |
633 |
|
634 |
|
635 |
|
636 |
|
637 | onDocumentHighlight(handler: ServerRequestHandler<DocumentHighlightParams, DocumentHighlight[] | undefined | null, DocumentHighlight[], void>): Disposable;
|
638 | |
639 |
|
640 |
|
641 |
|
642 |
|
643 | onDocumentSymbol(handler: ServerRequestHandler<DocumentSymbolParams, SymbolInformation[] | DocumentSymbol[] | undefined | null, SymbolInformation[] | DocumentSymbol[], void>): Disposable;
|
644 | |
645 |
|
646 |
|
647 |
|
648 |
|
649 | onWorkspaceSymbol(handler: ServerRequestHandler<WorkspaceSymbolParams, SymbolInformation[] | WorkspaceSymbol[] | undefined | null, SymbolInformation[], void>): Disposable;
|
650 | |
651 |
|
652 |
|
653 |
|
654 |
|
655 | onWorkspaceSymbolResolve(handler: RequestHandler<WorkspaceSymbol, WorkspaceSymbol, void>): Disposable;
|
656 | |
657 |
|
658 |
|
659 |
|
660 |
|
661 | onCodeAction(handler: ServerRequestHandler<CodeActionParams, (Command | CodeAction)[] | undefined | null, (Command | CodeAction)[], void>): Disposable;
|
662 | |
663 |
|
664 |
|
665 |
|
666 |
|
667 | onCodeActionResolve(handler: RequestHandler<CodeAction, CodeAction, void>): Disposable;
|
668 | |
669 |
|
670 |
|
671 |
|
672 |
|
673 |
|
674 |
|
675 | onCodeLens(handler: ServerRequestHandler<CodeLensParams, CodeLens[] | undefined | null, CodeLens[], void>): Disposable;
|
676 | |
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 | onCodeLensResolve(handler: RequestHandler<CodeLens, CodeLens, void>): Disposable;
|
683 | |
684 |
|
685 |
|
686 |
|
687 |
|
688 | onDocumentFormatting(handler: ServerRequestHandler<DocumentFormattingParams, TextEdit[] | undefined | null, never, void>): Disposable;
|
689 | |
690 |
|
691 |
|
692 |
|
693 |
|
694 | onDocumentRangeFormatting(handler: ServerRequestHandler<DocumentRangeFormattingParams, TextEdit[] | undefined | null, never, void>): Disposable;
|
695 | |
696 |
|
697 |
|
698 |
|
699 |
|
700 | onDocumentOnTypeFormatting(handler: RequestHandler<DocumentOnTypeFormattingParams, TextEdit[] | undefined | null, void>): Disposable;
|
701 | |
702 |
|
703 |
|
704 |
|
705 |
|
706 | onRenameRequest(handler: ServerRequestHandler<RenameParams, WorkspaceEdit | undefined | null, never, void>): Disposable;
|
707 | |
708 |
|
709 |
|
710 |
|
711 |
|
712 | onPrepareRename(handler: RequestHandler<PrepareRenameParams, Range | {
|
713 | range: Range;
|
714 | placeholder: string;
|
715 | } | {
|
716 | defaultBehavior: boolean;
|
717 | } | undefined | null, void>): Disposable;
|
718 | |
719 |
|
720 |
|
721 |
|
722 |
|
723 | onDocumentLinks(handler: ServerRequestHandler<DocumentLinkParams, DocumentLink[] | undefined | null, DocumentLink[], void>): Disposable;
|
724 | |
725 |
|
726 |
|
727 |
|
728 |
|
729 | onDocumentLinkResolve(handler: RequestHandler<DocumentLink, DocumentLink | undefined | null, void>): Disposable;
|
730 | |
731 |
|
732 |
|
733 |
|
734 |
|
735 | onDocumentColor(handler: ServerRequestHandler<DocumentColorParams, ColorInformation[] | undefined | null, ColorInformation[], void>): Disposable;
|
736 | |
737 |
|
738 |
|
739 |
|
740 |
|
741 | onColorPresentation(handler: ServerRequestHandler<ColorPresentationParams, ColorPresentation[] | undefined | null, ColorPresentation[], void>): Disposable;
|
742 | |
743 |
|
744 |
|
745 |
|
746 |
|
747 | onFoldingRanges(handler: ServerRequestHandler<FoldingRangeParams, FoldingRange[] | undefined | null, FoldingRange[], void>): Disposable;
|
748 | |
749 |
|
750 |
|
751 |
|
752 |
|
753 | onSelectionRanges(handler: ServerRequestHandler<SelectionRangeParams, SelectionRange[] | undefined | null, SelectionRange[], void>): Disposable;
|
754 | |
755 |
|
756 |
|
757 |
|
758 |
|
759 | onExecuteCommand(handler: ServerRequestHandler<ExecuteCommandParams, any | undefined | null, never, void>): Disposable;
|
760 | |
761 |
|
762 |
|
763 | dispose(): void;
|
764 | }
|
765 | export interface Connection extends _Connection {
|
766 | }
|
767 | export interface Feature<B extends FeatureBase, P> {
|
768 | (Base: new () => B): new () => B & P;
|
769 | }
|
770 | export type ConsoleFeature<P> = Feature<RemoteConsole, P>;
|
771 | export declare function combineConsoleFeatures<O, T>(one: ConsoleFeature<O>, two: ConsoleFeature<T>): ConsoleFeature<O & T>;
|
772 | export type TelemetryFeature<P> = Feature<Telemetry, P>;
|
773 | export declare function combineTelemetryFeatures<O, T>(one: TelemetryFeature<O>, two: TelemetryFeature<T>): TelemetryFeature<O & T>;
|
774 | export type TracerFeature<P> = Feature<RemoteTracer, P>;
|
775 | export declare function combineTracerFeatures<O, T>(one: TracerFeature<O>, two: TracerFeature<T>): TracerFeature<O & T>;
|
776 | export type ClientFeature<P> = Feature<RemoteClient, P>;
|
777 | export declare function combineClientFeatures<O, T>(one: ClientFeature<O>, two: ClientFeature<T>): ClientFeature<O & T>;
|
778 | export type WindowFeature<P> = Feature<_RemoteWindow, P>;
|
779 | export declare function combineWindowFeatures<O, T>(one: WindowFeature<O>, two: WindowFeature<T>): WindowFeature<O & T>;
|
780 | export type WorkspaceFeature<P> = Feature<_RemoteWorkspace, P>;
|
781 | export declare function combineWorkspaceFeatures<O, T>(one: WorkspaceFeature<O>, two: WorkspaceFeature<T>): WorkspaceFeature<O & T>;
|
782 | export type LanguagesFeature<P> = Feature<_Languages, P>;
|
783 | export declare function combineLanguagesFeatures<O, T>(one: LanguagesFeature<O>, two: LanguagesFeature<T>): LanguagesFeature<O & T>;
|
784 | export type NotebooksFeature<P> = Feature<_Notebooks, P>;
|
785 | export declare function combineNotebooksFeatures<O, T>(one: NotebooksFeature<O>, two: NotebooksFeature<T>): NotebooksFeature<O & T>;
|
786 | export interface Features<PConsole = _, PTracer = _, PTelemetry = _, PClient = _, PWindow = _, PWorkspace = _, PLanguages = _, PNotebooks = _> {
|
787 | __brand: 'features';
|
788 | console?: ConsoleFeature<PConsole>;
|
789 | tracer?: TracerFeature<PTracer>;
|
790 | telemetry?: TelemetryFeature<PTelemetry>;
|
791 | client?: ClientFeature<PClient>;
|
792 | window?: WindowFeature<PWindow>;
|
793 | workspace?: WorkspaceFeature<PWorkspace>;
|
794 | languages?: LanguagesFeature<PLanguages>;
|
795 | notebooks?: NotebooksFeature<PNotebooks>;
|
796 | }
|
797 | export declare function combineFeatures<OConsole, OTracer, OTelemetry, OClient, OWindow, OWorkspace, OLanguages, ONotebooks, TConsole, TTracer, TTelemetry, TClient, TWindow, TWorkspace, TLanguages, TNotebooks>(one: Features<OConsole, OTracer, OTelemetry, OClient, OWindow, OWorkspace, OLanguages, ONotebooks>, two: Features<TConsole, TTracer, TTelemetry, TClient, TWindow, TWorkspace, TLanguages, TNotebooks>): Features<OConsole & TConsole, OTracer & TTracer, OTelemetry & TTelemetry, OClient & TClient, OWindow & TWindow, OWorkspace & TWorkspace, OLanguages & TLanguages, ONotebooks & TNotebooks>;
|
798 | export interface WatchDog {
|
799 | shutdownReceived: boolean;
|
800 | initialize(params: InitializeParams): void;
|
801 | exit(code: number): void;
|
802 | }
|
803 | export declare function createConnection<PConsole = _, PTracer = _, PTelemetry = _, PClient = _, PWindow = _, PWorkspace = _, PLanguages = _, PNotebooks = _>(connectionFactory: (logger: Logger) => ProtocolConnection, watchDog: WatchDog, factories?: Features<PConsole, PTracer, PTelemetry, PClient, PWindow, PWorkspace, PLanguages, PNotebooks>): _Connection<PConsole, PTracer, PTelemetry, PClient, PWindow, PWorkspace, PLanguages, PNotebooks>;
|
804 | export {};
|