massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-json / node_modules / vscode-languageserver / lib / common / server.d.ts
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, TextDocumentContentChangeEvent, TextDocumentSaveReason, Event, MessageSignature, ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, WorkDoneProgressParams, PartialResultParams, RegistrationType, RequestType0, RequestType, NotificationType0, NotificationType } from 'vscode-languageserver-protocol';
2 import { WorkDoneProgressReporter, ResultProgressReporter, WindowProgress } from './progress';
3 import { Configuration } from './configuration';
4 import { WorkspaceFolders } from './workspaceFolders';
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 { MonikerFeatureShape } from './moniker';
11 export interface TextDocumentsConfiguration<T> {
12     create(uri: string, languageId: string, version: number, content: string): T;
13     update(document: T, changes: TextDocumentContentChangeEvent[], version: number): T;
14 }
15 /**
16  * Event to signal changes to a text document.
17  */
18 export interface TextDocumentChangeEvent<T> {
19     /**
20      * The document that has changed.
21      */
22     document: T;
23 }
24 /**
25  * Event to signal that a document will be saved.
26  */
27 export interface TextDocumentWillSaveEvent<T> {
28     /**
29      * The document that will be saved
30      */
31     document: T;
32     /**
33      * The reason why save was triggered.
34      */
35     reason: TextDocumentSaveReason;
36 }
37 /**
38  * A manager for simple text documents
39  */
40 export declare class TextDocuments<T> {
41     private _configuration;
42     private _documents;
43     private _onDidChangeContent;
44     private _onDidOpen;
45     private _onDidClose;
46     private _onDidSave;
47     private _onWillSave;
48     private _willSaveWaitUntil;
49     /**
50      * Create a new text document manager.
51      */
52     constructor(configuration: TextDocumentsConfiguration<T>);
53     /**
54      * An event that fires when a text document managed by this manager
55      * has been opened or the content changes.
56      */
57     get onDidChangeContent(): Event<TextDocumentChangeEvent<T>>;
58     /**
59      * An event that fires when a text document managed by this manager
60      * has been opened.
61      */
62     get onDidOpen(): Event<TextDocumentChangeEvent<T>>;
63     /**
64      * An event that fires when a text document managed by this manager
65      * will be saved.
66      */
67     get onWillSave(): Event<TextDocumentWillSaveEvent<T>>;
68     /**
69      * Sets a handler that will be called if a participant wants to provide
70      * edits during a text document save.
71      */
72     onWillSaveWaitUntil(handler: RequestHandler<TextDocumentWillSaveEvent<T>, TextEdit[], void>): void;
73     /**
74      * An event that fires when a text document managed by this manager
75      * has been saved.
76      */
77     get onDidSave(): Event<TextDocumentChangeEvent<T>>;
78     /**
79      * An event that fires when a text document managed by this manager
80      * has been closed.
81      */
82     get onDidClose(): Event<TextDocumentChangeEvent<T>>;
83     /**
84      * Returns the document for the given URI. Returns undefined if
85      * the document is not managed by this instance.
86      *
87      * @param uri The text document's URI to retrieve.
88      * @return the text document or `undefined`.
89      */
90     get(uri: string): T | undefined;
91     /**
92      * Returns all text documents managed by this instance.
93      *
94      * @return all text documents.
95      */
96     all(): T[];
97     /**
98      * Returns the URIs of all text documents managed by this instance.
99      *
100      * @return the URI's of all text documents.
101      */
102     keys(): string[];
103     /**
104      * Listens for `low level` notification on the given connection to
105      * update the text documents managed by this instance.
106      *
107      * Please note that the connection only provides handlers not an event model. Therefore
108      * listening on a connection will overwrite the following handlers on a connection:
109      * `onDidOpenTextDocument`, `onDidChangeTextDocument`, `onDidCloseTextDocument`,
110      * `onWillSaveTextDocument`, `onWillSaveTextDocumentWaitUntil` and `onDidSaveTextDocument`.
111      *
112      * Use the corresponding events on the TextDocuments instance instead.
113      *
114      * @param connection The connection to listen on.
115      */
116     listen(connection: Connection): void;
117 }
118 /**
119  * Helps tracking error message. Equal occurrences of the same
120  * message are only stored once. This class is for example
121  * useful if text documents are validated in a loop and equal
122  * error message should be folded into one.
123  */
124 export declare class ErrorMessageTracker {
125     private _messages;
126     constructor();
127     /**
128      * Add a message to the tracker.
129      *
130      * @param message The message to add.
131      */
132     add(message: string): void;
133     /**
134      * Send all tracked messages to the connection's window.
135      *
136      * @param connection The connection established between client and server.
137      */
138     sendErrors(connection: {
139         window: RemoteWindow;
140     }): void;
141 }
142 /**
143  *
144  */
145 interface Remote {
146     /**
147      * Attach the remote to the given connection.
148      *
149      * @param connection The connection this remote is operating on.
150      */
151     attach(connection: Connection): void;
152     /**
153      * The connection this remote is attached to.
154      */
155     connection: Connection;
156     /**
157      * Called to initialize the remote with the given
158      * client capabilities
159      *
160      * @param capabilities The client capabilities
161      */
162     initialize(capabilities: ClientCapabilities): void;
163     /**
164      * Called to fill in the server capabilities this feature implements.
165      *
166      * @param capabilities The server capabilities to fill.
167      */
168     fillServerCapabilities(capabilities: ServerCapabilities): void;
169 }
170 /**
171  * The RemoteConsole interface contains all functions to interact with
172  * the tools / clients console or log system. Internally it used `window/logMessage`
173  * notifications.
174  */
175 export interface RemoteConsole {
176     /**
177      * The connection this remote is attached to.
178      */
179     connection: Connection;
180     /**
181      * Show an error message.
182      *
183      * @param message The message to show.
184      */
185     error(message: string): void;
186     /**
187      * Show a warning message.
188      *
189      * @param message The message to show.
190      */
191     warn(message: string): void;
192     /**
193      * Show an information message.
194      *
195      * @param message The message to show.
196      */
197     info(message: string): void;
198     /**
199      * Log a message.
200      *
201      * @param message The message to log.
202      */
203     log(message: string): void;
204 }
205 /**
206  * The RemoteWindow interface contains all functions to interact with
207  * the visual window of VS Code.
208  */
209 export interface _RemoteWindow {
210     /**
211      * The connection this remote is attached to.
212      */
213     connection: Connection;
214     /**
215      * Shows an error message in the client's user interface. Depending on the client this might
216      * be a modal dialog with a confirmation button or a notification in a notification center
217      *
218      * @param message The message to show.
219      * @param actions Possible additional actions presented in the user interface. The selected action
220      *  will be the value of the resolved promise
221      */
222     showErrorMessage(message: string): void;
223     showErrorMessage<T extends MessageActionItem>(message: string, ...actions: T[]): Promise<T | undefined>;
224     /**
225      * Shows a warning message in the client's user interface. Depending on the client this might
226      * be a modal dialog with a confirmation button or a notification in a notification center
227      *
228      * @param message The message to show.
229      * @param actions Possible additional actions presented in the user interface. The selected action
230      *  will be the value of the resolved promise
231      */
232     showWarningMessage(message: string): void;
233     showWarningMessage<T extends MessageActionItem>(message: string, ...actions: T[]): Promise<T | undefined>;
234     /**
235      * Shows an information message in the client's user interface. Depending on the client this might
236      * be a modal dialog with a confirmation button or a notification in a notification center
237      *
238      * @param message The message to show.
239      * @param actions Possible additional actions presented in the user interface. The selected action
240      *  will be the value of the resolved promise
241      */
242     showInformationMessage(message: string): void;
243     showInformationMessage<T extends MessageActionItem>(message: string, ...actions: T[]): Promise<T | undefined>;
244 }
245 export declare type RemoteWindow = _RemoteWindow & WindowProgress & ShowDocumentFeatureShape;
246 /**
247  * A bulk registration manages n single registration to be able to register
248  * for n notifications or requests using one register request.
249  */
250 export interface BulkRegistration {
251     /**
252      * Adds a single registration.
253      * @param type the notification type to register for.
254      * @param registerParams special registration parameters.
255      */
256     add<RO>(type: ProtocolNotificationType0<RO>, registerParams: RO): void;
257     add<P, RO>(type: ProtocolNotificationType<P, RO>, registerParams: RO): void;
258     /**
259      * Adds a single registration.
260      * @param type the request type to register for.
261      * @param registerParams special registration parameters.
262      */
263     add<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, registerParams: RO): void;
264     add<P, PR, R, E, RO>(type: ProtocolRequestType<P, PR, R, E, RO>, registerParams: RO): void;
265     /**
266      * Adds a single registration.
267      * @param type the notification type to register for.
268      * @param registerParams special registration parameters.
269      */
270     add<RO>(type: RegistrationType<RO>, registerParams: RO): void;
271 }
272 export declare namespace BulkRegistration {
273     /**
274      * Creates a new bulk registration.
275      * @return an empty bulk registration.
276      */
277     function create(): BulkRegistration;
278 }
279 /**
280  * A `BulkUnregistration` manages n unregistrations.
281  */
282 export interface BulkUnregistration extends Disposable {
283     /**
284      * Disposes a single registration. It will be removed from the
285      * `BulkUnregistration`.
286      */
287     disposeSingle(arg: string | MessageSignature): boolean;
288 }
289 export declare namespace BulkUnregistration {
290     function create(): BulkUnregistration;
291 }
292 /**
293  * Interface to register and unregister `listeners` on the client / tools side.
294  */
295 export interface RemoteClient {
296     /**
297      * The connection this remote is attached to.
298      */
299     connection: Connection;
300     /**
301      * Registers a listener for the given request.
302      *
303      * @param type the request type to register for.
304      * @param registerParams special registration parameters.
305      * @return a `Disposable` to unregister the listener again.
306      */
307     register<P, RO>(type: ProtocolNotificationType<P, RO>, registerParams?: RO): Promise<Disposable>;
308     register<RO>(type: ProtocolNotificationType0<RO>, registerParams?: RO): Promise<Disposable>;
309     /**
310      * Registers a listener for the given request.
311      *
312      * @param unregisteration the unregistration to add a corresponding unregister action to.
313      * @param type the request type to register for.
314      * @param registerParams special registration parameters.
315      * @return the updated unregistration.
316      */
317     register<P, RO>(unregisteration: BulkUnregistration, type: ProtocolNotificationType<P, RO>, registerParams?: RO): Promise<Disposable>;
318     register<RO>(unregisteration: BulkUnregistration, type: ProtocolNotificationType0<RO>, registerParams?: RO): Promise<Disposable>;
319     /**
320      * Registers a listener for the given request.
321      *
322      * @param type the request type to register for.
323      * @param registerParams special registration parameters.
324      * @return a `Disposable` to unregister the listener again.
325      */
326     register<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
327     register<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
328     /**
329      * Registers a listener for the given request.
330      *
331      * @param unregisteration the unregistration to add a corresponding unregister action to.
332      * @param type the request type to register for.
333      * @param registerParams special registration parameters.
334      * @return the updated unregistration.
335      */
336     register<P, R, PR, E, RO>(unregisteration: BulkUnregistration, type: ProtocolRequestType<P, R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
337     register<R, PR, E, RO>(unregisteration: BulkUnregistration, type: ProtocolRequestType0<R, PR, E, RO>, registerParams?: RO): Promise<Disposable>;
338     /**
339      * Registers a listener for the given registration type.
340      *
341      * @param type the registration type.
342      * @param registerParams special registration parameters.
343      * @return a `Disposable` to unregister the listener again.
344      */
345     register<RO>(type: RegistrationType<RO>, registerParams?: RO): Promise<Disposable>;
346     /**
347      * Registers a listener for the given registration type.
348      *
349      * @param unregisteration the unregistration to add a corresponding unregister action to.
350      * @param type the registration type.
351      * @param registerParams special registration parameters.
352      * @return the updated unregistration.
353      */
354     register<RO>(unregisteration: BulkUnregistration, type: RegistrationType<RO>, registerParams?: RO): Promise<Disposable>;
355     /**
356      * Registers a set of listeners.
357      * @param registrations the bulk registration
358      * @return a `Disposable` to unregister the listeners again.
359      */
360     register(registrations: BulkRegistration): Promise<BulkUnregistration>;
361 }
362 /**
363  * Represents the workspace managed by the client.
364  */
365 export interface _RemoteWorkspace {
366     /**
367      * The connection this remote is attached to.
368      */
369     connection: Connection;
370     /**
371      * Applies a `WorkspaceEdit` to the workspace
372      * @param param the workspace edit params.
373      * @return a thenable that resolves to the `ApplyWorkspaceEditResponse`.
374      */
375     applyEdit(paramOrEdit: ApplyWorkspaceEditParams | WorkspaceEdit): Promise<ApplyWorkspaceEditResponse>;
376 }
377 export declare type RemoteWorkspace = _RemoteWorkspace & Configuration & WorkspaceFolders & FileOperationsFeatureShape;
378 /**
379  * Interface to log telemetry events. The events are actually send to the client
380  * and the client needs to feed the event into a proper telemetry system.
381  */
382 export interface Telemetry {
383     /**
384      * The connection this remote is attached to.
385      */
386     connection: Connection;
387     /**
388      * Log the given data to telemetry.
389      *
390      * @param data The data to log. Must be a JSON serializable object.
391      */
392     logEvent(data: any): void;
393 }
394 /**
395  * Interface to log traces to the client. The events are sent to the client and the
396  * client needs to log the trace events.
397  */
398 export interface RemoteTracer {
399     /**
400      * The connection this remote is attached to.
401      */
402     connection: Connection;
403     /**
404      * Log the given data to the trace Log
405      */
406     log(message: string, verbose?: string): void;
407 }
408 export interface _Languages {
409     connection: Connection;
410     attachWorkDoneProgress(params: WorkDoneProgressParams): WorkDoneProgressReporter;
411     attachPartialResultProgress<PR>(type: ProgressType<PR>, params: PartialResultParams): ResultProgressReporter<PR> | undefined;
412 }
413 export declare class _LanguagesImpl implements Remote, _Languages {
414     private _connection;
415     constructor();
416     attach(connection: Connection): void;
417     get connection(): Connection;
418     initialize(_capabilities: ClientCapabilities): void;
419     fillServerCapabilities(_capabilities: ServerCapabilities): void;
420     attachWorkDoneProgress(params: WorkDoneProgressParams): WorkDoneProgressReporter;
421     attachPartialResultProgress<PR>(_type: ProgressType<PR>, params: PartialResultParams): ResultProgressReporter<PR> | undefined;
422 }
423 export declare type Languages = _Languages & CallHierarchy & SemanticTokensFeatureShape & LinkedEditingRangeFeatureShape & MonikerFeatureShape;
424 /**
425  * An empty interface for new proposed API.
426  */
427 export interface _ {
428 }
429 export interface ServerRequestHandler<P, R, PR, E> {
430     (params: P, token: CancellationToken, workDoneProgress: WorkDoneProgressReporter, resultProgress?: ResultProgressReporter<PR>): HandlerResult<R, E>;
431 }
432 /**
433  * Interface to describe the shape of the server connection.
434  */
435 export interface _Connection<PConsole = _, PTracer = _, PTelemetry = _, PClient = _, PWindow = _, PWorkspace = _, PLanguages = _> {
436     /**
437      * Start listening on the input stream for messages to process.
438      */
439     listen(): void;
440     /**
441      * Installs a request handler described by the given [RequestType](#RequestType).
442      *
443      * @param type The [RequestType](#RequestType) describing the request.
444      * @param handler The handler to install
445      */
446     onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): void;
447     onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): void;
448     onRequest<R, PR, E, RO>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): void;
449     onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): void;
450     /**
451      * Installs a request handler for the given method.
452      *
453      * @param method The method to register a request handler for.
454      * @param handler The handler to install.
455      */
456     onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): void;
457     /**
458      * Installs a request handler that is invoked if no specific request handler can be found.
459      *
460      * @param handler a handler that handles all requests.
461      */
462     onRequest(handler: StarRequestHandler): void;
463     /**
464      * Send a request to the client.
465      *
466      * @param type The [RequestType](#RequestType) describing the request.
467      * @param params The request's parameters.
468      */
469     sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
470     sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;
471     sendRequest<R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>;
472     sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
473     /**
474      * Send a request to the client.
475      *
476      * @param method The method to invoke on the client.
477      * @param params The request's parameters.
478      */
479     sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;
480     sendRequest<R>(method: string, params: any, token?: CancellationToken): Promise<R>;
481     /**
482      * Installs a notification handler described by the given [NotificationType](#NotificationType).
483      *
484      * @param type The [NotificationType](#NotificationType) describing the notification.
485      * @param handler The handler to install.
486      */
487     onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): void;
488     onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): void;
489     onNotification(type: NotificationType0, handler: NotificationHandler0): void;
490     onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): void;
491     /**
492      * Installs a notification handler for the given method.
493      *
494      * @param method The method to register a request handler for.
495      * @param handler The handler to install.
496      */
497     onNotification(method: string, handler: GenericNotificationHandler): void;
498     /**
499      * Installs a notification handler that is invoked if no specific notification handler can be found.
500      *
501      * @param handler a handler that handles all notifications.
502      */
503     onNotification(handler: StarNotificationHandler): void;
504     /**
505      * Send a notification to the client.
506      *
507      * @param type The [NotificationType](#NotificationType) describing the notification.
508      * @param params The notification's parameters.
509      */
510     sendNotification<RO>(type: ProtocolNotificationType0<RO>): void;
511     sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params: P): void;
512     sendNotification(type: NotificationType0): void;
513     sendNotification<P>(type: NotificationType<P>, params: P): void;
514     /**
515      * Send a notification to the client.
516      *
517      * @param method The method to invoke on the client.
518      * @param params The notification's parameters.
519      */
520     sendNotification(method: string, params?: any): void;
521     /**
522      * Installs a progress handler for a given token.
523      * @param type the progress type
524      * @param token the token
525      * @param handler the handler
526      */
527     onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
528     /**
529      * Sends progress.
530      * @param type the progress type
531      * @param token the token to use
532      * @param value the progress value
533      */
534     sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): void;
535     /**
536      * Installs a handler for the initialize request.
537      *
538      * @param handler The initialize handler.
539      */
540     onInitialize(handler: ServerRequestHandler<InitializeParams, InitializeResult, never, InitializeError>): void;
541     /**
542      * Installs a handler for the initialized notification.
543      *
544      * @param handler The initialized handler.
545      */
546     onInitialized(handler: NotificationHandler<InitializedParams>): void;
547     /**
548      * Installs a handler for the shutdown request.
549      *
550      * @param handler The initialize handler.
551      */
552     onShutdown(handler: RequestHandler0<void, void>): void;
553     /**
554      * Installs a handler for the exit notification.
555      *
556      * @param handler The exit handler.
557      */
558     onExit(handler: NotificationHandler0): void;
559     /**
560      * A property to provide access to console specific features.
561      */
562     console: RemoteConsole & PConsole;
563     /**
564      * A property to provide access to tracer specific features.
565      */
566     tracer: RemoteTracer & PTracer;
567     /**
568      * A property to provide access to telemetry specific features.
569      */
570     telemetry: Telemetry & PTelemetry;
571     /**
572      * A property to provide access to client specific features like registering
573      * for requests or notifications.
574      */
575     client: RemoteClient & PClient;
576     /**
577      * A property to provide access to windows specific features.
578      */
579     window: RemoteWindow & PWindow;
580     /**
581      * A property to provide access to workspace specific features.
582      */
583     workspace: RemoteWorkspace & PWorkspace;
584     /**
585      * A property to provide access to language specific features.
586      */
587     languages: Languages & PLanguages;
588     /**
589      * Installs a handler for the `DidChangeConfiguration` notification.
590      *
591      * @param handler The corresponding handler.
592      */
593     onDidChangeConfiguration(handler: NotificationHandler<DidChangeConfigurationParams>): void;
594     /**
595      * Installs a handler for the `DidChangeWatchedFiles` notification.
596      *
597      * @param handler The corresponding handler.
598      */
599     onDidChangeWatchedFiles(handler: NotificationHandler<DidChangeWatchedFilesParams>): void;
600     /**
601      * Installs a handler for the `DidOpenTextDocument` notification.
602      *
603      * @param handler The corresponding handler.
604      */
605     onDidOpenTextDocument(handler: NotificationHandler<DidOpenTextDocumentParams>): void;
606     /**
607      * Installs a handler for the `DidChangeTextDocument` notification.
608      *
609      * @param handler The corresponding handler.
610      */
611     onDidChangeTextDocument(handler: NotificationHandler<DidChangeTextDocumentParams>): void;
612     /**
613      * Installs a handler for the `DidCloseTextDocument` notification.
614      *
615      * @param handler The corresponding handler.
616      */
617     onDidCloseTextDocument(handler: NotificationHandler<DidCloseTextDocumentParams>): void;
618     /**
619      * Installs a handler for the `WillSaveTextDocument` notification.
620      *
621      * Note that this notification is opt-in. The client will not send it unless
622      * your server has the `textDocumentSync.willSave` capability or you've
623      * dynamically registered for the `textDocument/willSave` method.
624      *
625      * @param handler The corresponding handler.
626      */
627     onWillSaveTextDocument(handler: NotificationHandler<WillSaveTextDocumentParams>): void;
628     /**
629      * Installs a handler for the `WillSaveTextDocumentWaitUntil` request.
630      *
631      * Note that this request is opt-in. The client will not send it unless
632      * your server has the `textDocumentSync.willSaveWaitUntil` capability,
633      * or you've dynamically registered for the `textDocument/willSaveWaitUntil`
634      * method.
635      *
636      * @param handler The corresponding handler.
637      */
638     onWillSaveTextDocumentWaitUntil(handler: RequestHandler<WillSaveTextDocumentParams, TextEdit[] | undefined | null, void>): void;
639     /**
640      * Installs a handler for the `DidSaveTextDocument` notification.
641      *
642      * @param handler The corresponding handler.
643      */
644     onDidSaveTextDocument(handler: NotificationHandler<DidSaveTextDocumentParams>): void;
645     /**
646      * Sends diagnostics computed for a given document to VSCode to render them in the
647      * user interface.
648      *
649      * @param params The diagnostic parameters.
650      */
651     sendDiagnostics(params: PublishDiagnosticsParams): void;
652     /**
653      * Installs a handler for the `Hover` request.
654      *
655      * @param handler The corresponding handler.
656      */
657     onHover(handler: ServerRequestHandler<HoverParams, Hover | undefined | null, never, void>): void;
658     /**
659      * Installs a handler for the `Completion` request.
660      *
661      * @param handler The corresponding handler.
662      */
663     onCompletion(handler: ServerRequestHandler<CompletionParams, CompletionItem[] | CompletionList | undefined | null, CompletionItem[], void>): void;
664     /**
665      * Installs a handler for the `CompletionResolve` request.
666      *
667      * @param handler The corresponding handler.
668      */
669     onCompletionResolve(handler: RequestHandler<CompletionItem, CompletionItem, void>): void;
670     /**
671      * Installs a handler for the `SignatureHelp` request.
672      *
673      * @param handler The corresponding handler.
674      */
675     onSignatureHelp(handler: ServerRequestHandler<SignatureHelpParams, SignatureHelp | undefined | null, never, void>): void;
676     /**
677      * Installs a handler for the `Declaration` request.
678      *
679      * @param handler The corresponding handler.
680      */
681     onDeclaration(handler: ServerRequestHandler<DeclarationParams, Declaration | DeclarationLink[] | undefined | null, Location[] | DeclarationLink[], void>): void;
682     /**
683      * Installs a handler for the `Definition` request.
684      *
685      * @param handler The corresponding handler.
686      */
687     onDefinition(handler: ServerRequestHandler<DefinitionParams, Definition | DefinitionLink[] | undefined | null, Location[] | DefinitionLink[], void>): void;
688     /**
689      * Installs a handler for the `Type Definition` request.
690      *
691      * @param handler The corresponding handler.
692      */
693     onTypeDefinition(handler: ServerRequestHandler<TypeDefinitionParams, Definition | DefinitionLink[] | undefined | null, Location[] | DefinitionLink[], void>): void;
694     /**
695      * Installs a handler for the `Implementation` request.
696      *
697      * @param handler The corresponding handler.
698      */
699     onImplementation(handler: ServerRequestHandler<ImplementationParams, Definition | DefinitionLink[] | undefined | null, Location[] | DefinitionLink[], void>): void;
700     /**
701      * Installs a handler for the `References` request.
702      *
703      * @param handler The corresponding handler.
704      */
705     onReferences(handler: ServerRequestHandler<ReferenceParams, Location[] | undefined | null, Location[], void>): void;
706     /**
707      * Installs a handler for the `DocumentHighlight` request.
708      *
709      * @param handler The corresponding handler.
710      */
711     onDocumentHighlight(handler: ServerRequestHandler<DocumentHighlightParams, DocumentHighlight[] | undefined | null, DocumentHighlight[], void>): void;
712     /**
713      * Installs a handler for the `DocumentSymbol` request.
714      *
715      * @param handler The corresponding handler.
716      */
717     onDocumentSymbol(handler: ServerRequestHandler<DocumentSymbolParams, SymbolInformation[] | DocumentSymbol[] | undefined | null, SymbolInformation[] | DocumentSymbol[], void>): void;
718     /**
719      * Installs a handler for the `WorkspaceSymbol` request.
720      *
721      * @param handler The corresponding handler.
722      */
723     onWorkspaceSymbol(handler: ServerRequestHandler<WorkspaceSymbolParams, SymbolInformation[] | undefined | null, SymbolInformation[], void>): void;
724     /**
725      * Installs a handler for the `CodeAction` request.
726      *
727      * @param handler The corresponding handler.
728      */
729     onCodeAction(handler: ServerRequestHandler<CodeActionParams, (Command | CodeAction)[] | undefined | null, (Command | CodeAction)[], void>): void;
730     /**
731      * Installs a handler for the `CodeAction` resolve request.
732      *
733      * @param handler The corresponding handler.
734      */
735     onCodeActionResolve(handler: RequestHandler<CodeAction, CodeAction, void>): void;
736     /**
737      * Compute a list of [lenses](#CodeLens). This call should return as fast as possible and if
738      * computing the commands is expensive implementers should only return code lens objects with the
739      * range set and handle the resolve request.
740      *
741      * @param handler The corresponding handler.
742      */
743     onCodeLens(handler: ServerRequestHandler<CodeLensParams, CodeLens[] | undefined | null, CodeLens[], void>): void;
744     /**
745      * This function will be called for each visible code lens, usually when scrolling and after
746      * the onCodeLens has been called.
747      *
748      * @param handler The corresponding handler.
749      */
750     onCodeLensResolve(handler: RequestHandler<CodeLens, CodeLens, void>): void;
751     /**
752      * Installs a handler for the document formatting request.
753      *
754      * @param handler The corresponding handler.
755      */
756     onDocumentFormatting(handler: ServerRequestHandler<DocumentFormattingParams, TextEdit[] | undefined | null, never, void>): void;
757     /**
758      * Installs a handler for the document range formatting request.
759      *
760      * @param handler The corresponding handler.
761      */
762     onDocumentRangeFormatting(handler: ServerRequestHandler<DocumentRangeFormattingParams, TextEdit[] | undefined | null, never, void>): void;
763     /**
764      * Installs a handler for the document on type formatting request.
765      *
766      * @param handler The corresponding handler.
767      */
768     onDocumentOnTypeFormatting(handler: RequestHandler<DocumentOnTypeFormattingParams, TextEdit[] | undefined | null, void>): void;
769     /**
770      * Installs a handler for the rename request.
771      *
772      * @param handler The corresponding handler.
773      */
774     onRenameRequest(handler: ServerRequestHandler<RenameParams, WorkspaceEdit | undefined | null, never, void>): void;
775     /**
776      * Installs a handler for the prepare rename request.
777      *
778      * @param handler The corresponding handler.
779      */
780     onPrepareRename(handler: RequestHandler<PrepareRenameParams, Range | {
781         range: Range;
782         placeholder: string;
783     } | undefined | null, void>): void;
784     /**
785      * Installs a handler for the document links request.
786      *
787      * @param handler The corresponding handler.
788      */
789     onDocumentLinks(handler: ServerRequestHandler<DocumentLinkParams, DocumentLink[] | undefined | null, DocumentLink[], void>): void;
790     /**
791      * Installs a handler for the document links resolve request.
792      *
793      * @param handler The corresponding handler.
794      */
795     onDocumentLinkResolve(handler: RequestHandler<DocumentLink, DocumentLink | undefined | null, void>): void;
796     /**
797      * Installs a handler for the document color request.
798      *
799      * @param handler The corresponding handler.
800      */
801     onDocumentColor(handler: ServerRequestHandler<DocumentColorParams, ColorInformation[] | undefined | null, ColorInformation[], void>): void;
802     /**
803      * Installs a handler for the document color request.
804      *
805      * @param handler The corresponding handler.
806      */
807     onColorPresentation(handler: ServerRequestHandler<ColorPresentationParams, ColorPresentation[] | undefined | null, ColorPresentation[], void>): void;
808     /**
809      * Installs a handler for the folding ranges request.
810      *
811      * @param handler The corresponding handler.
812      */
813     onFoldingRanges(handler: ServerRequestHandler<FoldingRangeParams, FoldingRange[] | undefined | null, FoldingRange[], void>): void;
814     /**
815      * Installs a handler for the selection ranges request.
816      *
817      * @param handler The corresponding handler.
818      */
819     onSelectionRanges(handler: ServerRequestHandler<SelectionRangeParams, SelectionRange[] | undefined | null, SelectionRange[], void>): void;
820     /**
821      * Installs a handler for the execute command request.
822      *
823      * @param handler The corresponding handler.
824      */
825     onExecuteCommand(handler: ServerRequestHandler<ExecuteCommandParams, any | undefined | null, never, void>): void;
826     /**
827      * Disposes the connection
828      */
829     dispose(): void;
830 }
831 export interface Connection extends _Connection {
832 }
833 export interface Feature<B, P> {
834     (Base: new () => B): new () => B & P;
835 }
836 export declare type ConsoleFeature<P> = Feature<RemoteConsole, P>;
837 export declare function combineConsoleFeatures<O, T>(one: ConsoleFeature<O>, two: ConsoleFeature<T>): ConsoleFeature<O & T>;
838 export declare type TelemetryFeature<P> = Feature<Telemetry, P>;
839 export declare function combineTelemetryFeatures<O, T>(one: TelemetryFeature<O>, two: TelemetryFeature<T>): TelemetryFeature<O & T>;
840 export declare type TracerFeature<P> = Feature<RemoteTracer, P>;
841 export declare function combineTracerFeatures<O, T>(one: TracerFeature<O>, two: TracerFeature<T>): TracerFeature<O & T>;
842 export declare type ClientFeature<P> = Feature<RemoteClient, P>;
843 export declare function combineClientFeatures<O, T>(one: ClientFeature<O>, two: ClientFeature<T>): ClientFeature<O & T>;
844 export declare type WindowFeature<P> = Feature<_RemoteWindow, P>;
845 export declare function combineWindowFeatures<O, T>(one: WindowFeature<O>, two: WindowFeature<T>): WindowFeature<O & T>;
846 export declare type WorkspaceFeature<P> = Feature<_RemoteWorkspace, P>;
847 export declare function combineWorkspaceFeatures<O, T>(one: WorkspaceFeature<O>, two: WorkspaceFeature<T>): WorkspaceFeature<O & T>;
848 export declare type LanguagesFeature<P> = Feature<_Languages, P>;
849 export declare function combineLanguagesFeatures<O, T>(one: LanguagesFeature<O>, two: LanguagesFeature<T>): LanguagesFeature<O & T>;
850 export interface Features<PConsole = _, PTracer = _, PTelemetry = _, PClient = _, PWindow = _, PWorkspace = _, PLanguages = _> {
851     __brand: 'features';
852     console?: ConsoleFeature<PConsole>;
853     tracer?: TracerFeature<PTracer>;
854     telemetry?: TelemetryFeature<PTelemetry>;
855     client?: ClientFeature<PClient>;
856     window?: WindowFeature<PWindow>;
857     workspace?: WorkspaceFeature<PWorkspace>;
858     languages?: LanguagesFeature<PLanguages>;
859 }
860 export declare function combineFeatures<OConsole, OTracer, OTelemetry, OClient, OWindow, OWorkspace, TConsole, TTracer, TTelemetry, TClient, TWindow, TWorkspace>(one: Features<OConsole, OTracer, OTelemetry, OClient, OWindow, OWorkspace>, two: Features<TConsole, TTracer, TTelemetry, TClient, TWindow, TWorkspace>): Features<OConsole & TConsole, OTracer & TTracer, OTelemetry & TTelemetry, OClient & TClient, OWindow & TWindow, OWorkspace & TWorkspace>;
861 export interface WatchDog {
862     shutdownReceived: boolean;
863     initialize(params: InitializeParams): void;
864     exit(code: number): void;
865 }
866 export declare function createConnection<PConsole = _, PTracer = _, PTelemetry = _, PClient = _, PWindow = _, PWorkspace = _, PLanguages = _>(connectionFactory: (logger: Logger) => ProtocolConnection, watchDog: WatchDog, factories?: Features<PConsole, PTracer, PTelemetry, PClient, PWindow, PWorkspace, PLanguages>): _Connection<PConsole, PTracer, PTelemetry, PClient, PWindow, PWorkspace, PLanguages>;
867 export {};