@codingame/monaco-languageclient-wrapper 3.2.4 → 3.2.5

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/dist/index.d.ts CHANGED
@@ -1,19 +1,10 @@
1
1
  import * as code from 'vscode';
2
- import { TextDocument, TextDocumentChangeEvent, TextDocumentWillSaveEvent, TextEdit, ProviderResult, CodeLens, CodeLensProvider, EventEmitter, Range, InlineValueContext, InlineValue, InlineValuesProvider, InlayHint, InlayHintsProvider, Uri, CancellationToken as CancellationToken$1, Diagnostic, Event, Disposable as Disposable$1, FileCreateEvent, FileRenameEvent, FileDeleteEvent, FileWillCreateEvent, FileWillRenameEvent, FileWillDeleteEvent, CompletionItemProvider, HoverProvider, SignatureHelpProvider, DefinitionProvider, ReferenceProvider, DocumentHighlightProvider, CodeActionProvider, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, RenameProvider, DocumentSymbolProvider, DocumentLinkProvider, DocumentColorProvider, DeclarationProvider, FoldingRangeProvider, ImplementationProvider, SelectionRangeProvider, TypeDefinitionProvider, CallHierarchyProvider, LinkedEditingRangeProvider, TypeHierarchyProvider, WorkspaceSymbolProvider, WorkspaceFolder, FileSystemWatcher, Position, CompletionContext, CompletionItem, CompletionList, Hover, Definition, DefinitionLink, SignatureHelpContext, SignatureHelp, DocumentHighlight, SymbolInformation, DocumentSymbol, Location, ColorInformation, Color, ColorPresentation, CodeActionContext, Command, CodeAction, FormattingOptions, WorkspaceEdit, DocumentLink, FoldingContext, FoldingRange, Declaration, SelectionRange, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall, TypeHierarchyItem, WorkspaceFoldersChangeEvent, OutputChannel, DiagnosticCollection } from 'vscode';
2
+ import { TextDocument, TextDocumentChangeEvent, TextDocumentWillSaveEvent, TextEdit, ProviderResult, CodeLens, CodeLensProvider, EventEmitter, Range, InlineValueContext, InlineValue, InlineValuesProvider, InlayHint, InlayHintsProvider, Uri, CancellationToken as CancellationToken$1, Diagnostic, Event, Disposable, FileCreateEvent, FileRenameEvent, FileDeleteEvent, FileWillCreateEvent, FileWillRenameEvent, FileWillDeleteEvent, CompletionItemProvider, HoverProvider, SignatureHelpProvider, DefinitionProvider, ReferenceProvider, DocumentHighlightProvider, CodeActionProvider, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, RenameProvider, DocumentSymbolProvider, DocumentLinkProvider, DocumentColorProvider, DeclarationProvider, FoldingRangeProvider, ImplementationProvider, SelectionRangeProvider, TypeDefinitionProvider, CallHierarchyProvider, LinkedEditingRangeProvider, TypeHierarchyProvider, WorkspaceSymbolProvider, WorkspaceFolder, FileSystemWatcher, Position, CompletionContext, CompletionItem, CompletionList, Hover, Definition, DefinitionLink, SignatureHelpContext, SignatureHelp, DocumentHighlight, SymbolInformation, DocumentSymbol, Location, ColorInformation, Color, ColorPresentation, CodeActionContext, Command, CodeAction, FormattingOptions, WorkspaceEdit, DocumentLink, FoldingContext, FoldingRange, Declaration, SelectionRange, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall, TypeHierarchyItem, WorkspaceFoldersChangeEvent, OutputChannel, DiagnosticCollection } from 'vscode';
3
3
  export { WorkspaceFolder } from 'vscode';
4
4
  import * as ls from 'vscode-languageserver-protocol';
5
5
  import { TextDocumentRegistrationOptions, DidOpenTextDocumentParams, DidCloseTextDocumentParams, TextDocumentChangeRegistrationOptions, DidChangeTextDocumentParams, DidSaveTextDocumentParams, CancellationToken, DocumentSelector, InitializeParams, ClientCapabilities, ServerCapabilities, RegistrationType, ProtocolRequestType0, ProtocolRequestType, RequestType0, RequestType, RequestHandler0, RequestHandler, GenericRequestHandler, ProtocolNotificationType0, ProtocolNotificationType, NotificationType0, NotificationType, NotificationHandler0, NotificationHandler, GenericNotificationHandler, ProgressType, MessageSignature, DidOpenTextDocumentNotification, DidChangeTextDocumentNotification, WillSaveTextDocumentNotification, WillSaveTextDocumentWaitUntilRequest, DidSaveTextDocumentNotification, DidCloseTextDocumentNotification, DidCreateFilesNotification, FileOperationRegistrationOptions, DidRenameFilesNotification, DidDeleteFilesNotification, WillCreateFilesRequest, WillRenameFilesRequest, WillDeleteFilesRequest, CompletionRequest, HoverRequest, SignatureHelpRequest, DefinitionRequest, ReferencesRequest, DocumentHighlightRequest, CodeActionRequest, CodeLensRequest, DocumentFormattingRequest, DocumentRangeFormattingRequest, DocumentOnTypeFormattingRequest, RenameRequest, DocumentSymbolRequest, DocumentLinkRequest, DocumentColorRequest, DeclarationRequest, FoldingRangeRequest, ImplementationRequest, SelectionRangeRequest, TypeDefinitionRequest, CallHierarchyPrepareRequest, SemanticTokensRegistrationType, LinkedEditingRangeRequest, TypeHierarchyPrepareRequest, InlineValueRequest, InlayHintRequest, WorkspaceSymbolRequest, DocumentDiagnosticRequest, NotebookDocumentSyncRegistrationType, NotebookDocumentSyncRegistrationOptions, ConfigurationRequest, WorkspaceFoldersRequest, MessageReader, MessageWriter, CancellationStrategy, ResponseError, InitializeError, Message, Event as Event$1, InitializeResult, Trace, ProgressToken, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd, FileEvent, ShowDocumentParams, ShowDocumentRequest, ShowDocumentResult, Emitter, TextDocumentSaveReason } from 'vscode-languageserver-protocol';
6
6
  import * as monaco from 'monaco-editor';
7
-
8
- interface Disposable {
9
- /**
10
- * Dispose this object.
11
- */
12
- dispose(): void;
13
- }
14
- declare namespace Disposable {
15
- function create(func: () => void): Disposable;
16
- }
7
+ import { Disposable as Disposable$1 } from 'vscode-languageserver-protocol/lib/common/api';
17
8
 
18
9
  interface FileFormattingOptions {
19
10
  trimTrailingWhitespace?: boolean;
@@ -406,7 +397,7 @@ declare type DiagnosticPullOptions = {
406
397
  * An optional filter method that is consulted when triggering a
407
398
  * diagnostic pull during document change or document save.
408
399
  *
409
- * @param document the document that changes or got save
400
+ * @param document the document that changed or got saved
410
401
  * @param mode the mode
411
402
  */
412
403
  filter?(document: TextDocument, mode: DiagnosticPullMode): boolean;
@@ -419,11 +410,11 @@ declare type DiagnosticPullOptions = {
419
410
  */
420
411
  onTabs?: boolean;
421
412
  /**
422
- * A optional match method that is consulted when pulling for diagnostics
413
+ * An optional match method that is consulted when pulling for diagnostics
423
414
  * when only a URI is known (e.g. for not instantiated tabs)
424
415
  *
425
416
  * @param documentSelector the document selector
426
- * @param resource the resource.
417
+ * @param resource the resource
427
418
  */
428
419
  match?(documentSelector: DocumentSelector, resource: Uri): boolean;
429
420
  };
@@ -718,23 +709,23 @@ interface FeatureClient<M, CO = object> {
718
709
  sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken$1): Promise<R>;
719
710
  sendRequest<R>(method: string, token?: CancellationToken$1): Promise<R>;
720
711
  sendRequest<R>(method: string, param: any, token?: CancellationToken$1): Promise<R>;
721
- onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable$1;
722
- onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable$1;
723
- onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable$1;
724
- onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable$1;
725
- onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable$1;
712
+ onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
713
+ onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
714
+ onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
715
+ onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
716
+ onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable;
726
717
  sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
727
718
  sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): Promise<void>;
728
719
  sendNotification(type: NotificationType0): Promise<void>;
729
720
  sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>;
730
721
  sendNotification(method: string): Promise<void>;
731
722
  sendNotification(method: string, params: any): Promise<void>;
732
- onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable$1;
733
- onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable$1;
734
- onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable$1;
735
- onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable$1;
736
- onNotification(method: string, handler: GenericNotificationHandler): Disposable$1;
737
- onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable$1;
723
+ onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
724
+ onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
725
+ onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
726
+ onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
727
+ onNotification(method: string, handler: GenericNotificationHandler): Disposable;
728
+ onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
738
729
  info(message: string, data?: any, showNotification?: boolean): void;
739
730
  warn(message: string, data?: any, showNotification?: boolean): void;
740
731
  error(message: string, data?: any, showNotification?: boolean | 'force'): void;
@@ -1260,6 +1251,8 @@ declare abstract class BaseLanguageClient implements FeatureClient<Middleware, L
1260
1251
  private _connection;
1261
1252
  private _idleInterval;
1262
1253
  private readonly _ignoredRegistrations;
1254
+ private readonly _listeners;
1255
+ private _disposed;
1263
1256
  private readonly _notificationHandlers;
1264
1257
  private readonly _notificationDisposables;
1265
1258
  private readonly _pendingNotificationHandlers;
@@ -1307,24 +1300,24 @@ declare abstract class BaseLanguageClient implements FeatureClient<Middleware, L
1307
1300
  sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken$1): Promise<R>;
1308
1301
  sendRequest<R>(method: string, token?: CancellationToken$1): Promise<R>;
1309
1302
  sendRequest<R>(method: string, param: any, token?: CancellationToken$1): Promise<R>;
1310
- onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable$1;
1311
- onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable$1;
1312
- onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable$1;
1313
- onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable$1;
1314
- onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable$1;
1303
+ onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
1304
+ onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
1305
+ onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
1306
+ onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
1307
+ onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable;
1315
1308
  sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
1316
1309
  sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): Promise<void>;
1317
1310
  sendNotification(type: NotificationType0): Promise<void>;
1318
1311
  sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>;
1319
1312
  sendNotification(method: string): Promise<void>;
1320
1313
  sendNotification(method: string, params: any): Promise<void>;
1321
- onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable$1;
1322
- onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable$1;
1323
- onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable$1;
1324
- onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable$1;
1325
- onNotification(method: string, handler: GenericNotificationHandler): Disposable$1;
1314
+ onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
1315
+ onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
1316
+ onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
1317
+ onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
1318
+ onNotification(method: string, handler: GenericNotificationHandler): Disposable;
1326
1319
  sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;
1327
- onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable$1;
1320
+ onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
1328
1321
  createDefaultErrorHandler(maxRestartCount?: number): ErrorHandler;
1329
1322
  setTrace(value: Trace): Promise<void>;
1330
1323
  private data2String;
@@ -1344,7 +1337,7 @@ declare abstract class BaseLanguageClient implements FeatureClient<Middleware, L
1344
1337
  private doInitialize;
1345
1338
  private _clientGetRootPath;
1346
1339
  stop(timeout?: number): Promise<void>;
1347
- suspend(): Promise<void>;
1340
+ dispose(timeout?: number): Promise<void>;
1348
1341
  private shutdown;
1349
1342
  private cleanUp;
1350
1343
  private cleanUpChannel;
@@ -1485,7 +1478,7 @@ declare type LanguageClientOptions = Pick<LanguageClientOptions$1, 'documentSele
1485
1478
  readinessMessageMatcher?: RegExp;
1486
1479
  createAdditionalFeatures?(client: MonacoLanguageClient): Promise<(StaticFeature | DynamicFeature<unknown>)[]>;
1487
1480
  };
1488
- declare function registerLanguageClient(id: string, options: LanguageClientOptions): Disposable;
1481
+ declare function registerLanguageClient(id: string, options: LanguageClientOptions): Disposable$1;
1489
1482
  declare type LanguageClientId = StaticLanguageClientId | string;
1490
1483
  declare function getLanguageClientOptions(id: LanguageClientId): LanguageClientOptions;
1491
1484