@codingame/monaco-languageclient-wrapper 2.1.4 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  /// <reference path="../node_modules/vscode-languageclient/typings/vscode-proposed.d.ts" />
2
+ import { NotificationType as NotificationType$2, RequestType as RequestType$2, TextDocumentSaveReason as TextDocumentSaveReason$1 } from 'vscode-languageserver-protocol/lib/common/api';
3
+ export { TextDocumentSaveReason } from 'vscode-languageserver-protocol/lib/common/api';
2
4
  import * as ls from 'vscode-languageserver-protocol';
3
- import { InitializeParams, InitializeResult, LogMessageParams, ShowMessageParams, DidChangeConfigurationParams, DidChangeWatchedFilesParams, DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, DidSaveTextDocumentParams, PublishDiagnosticsParams, CancellationToken as CancellationToken$2, ConfigurationRequest, WorkspaceFoldersRequest, DocumentSelector, MessageReader, MessageWriter, ProtocolRequestType0, ProtocolRequestType, RequestType0 as RequestType0$1, RequestType as RequestType$1, RequestHandler0 as RequestHandler0$1, RequestHandler as RequestHandler$1, GenericRequestHandler as GenericRequestHandler$1, ProtocolNotificationType0, ProtocolNotificationType, NotificationType0 as NotificationType0$1, NotificationType as NotificationType$1, NotificationHandler0 as NotificationHandler0$1, NotificationHandler as NotificationHandler$1, GenericNotificationHandler as GenericNotificationHandler$1, ProgressType as ProgressType$1, Event as Event$2, Trace as Trace$1, DidOpenTextDocumentNotification, TextDocumentRegistrationOptions, DidChangeTextDocumentNotification, WillSaveTextDocumentNotification, WillSaveTextDocumentWaitUntilRequest, DidSaveTextDocumentNotification, DidCloseTextDocumentNotification, DidCreateFilesNotification, FileOperationRegistrationOptions, DidRenameFilesNotification, DidDeleteFilesNotification, WillCreateFilesRequest, WillRenameFilesRequest, WillDeleteFilesRequest, CompletionRequest, HoverRequest, SignatureHelpRequest, DefinitionRequest, ReferencesRequest, DocumentHighlightRequest, CodeActionRequest, DocumentFormattingRequest, DocumentRangeFormattingRequest, DocumentOnTypeFormattingRequest, RenameRequest, DocumentSymbolRequest, DocumentLinkRequest, DocumentColorRequest, DeclarationRequest, FoldingRangeRequest, ImplementationRequest, SelectionRangeRequest, TypeDefinitionRequest, CallHierarchyPrepareRequest, SemanticTokensRegistrationType, LinkedEditingRangeRequest, WorkspaceSymbolRequest, MessageSignature as MessageSignature$1, CancellationStrategy, Message as Message$1, ResponseError as ResponseError$1, InitializeError, ClientCapabilities, ServerCapabilities, RegistrationType, ProgressToken, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd, FileEvent, ShowDocumentParams, ShowDocumentRequest, ShowDocumentResult, MessageConnection } from 'vscode-languageserver-protocol';
5
+ import { InitializeParams, InitializeResult, LogMessageParams, ShowMessageParams, DidChangeConfigurationParams, DidChangeWatchedFilesParams, DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, DidSaveTextDocumentParams, PublishDiagnosticsParams, CancellationToken as CancellationToken$2, ConfigurationRequest, WorkspaceFoldersRequest, DocumentSelector, CancellationStrategy, Message as Message$1, ResponseError as ResponseError$1, InitializeError, MessageReader, MessageWriter, ProtocolRequestType0, ProtocolRequestType, RequestType0 as RequestType0$1, RequestType as RequestType$1, RequestHandler0 as RequestHandler0$1, RequestHandler as RequestHandler$1, GenericRequestHandler as GenericRequestHandler$1, ProtocolNotificationType0, ProtocolNotificationType, NotificationType0 as NotificationType0$1, NotificationType as NotificationType$1, NotificationHandler0 as NotificationHandler0$1, NotificationHandler as NotificationHandler$1, GenericNotificationHandler as GenericNotificationHandler$1, ProgressType as ProgressType$1, Event as Event$2, Trace as Trace$1, DidOpenTextDocumentNotification, TextDocumentRegistrationOptions, DidChangeTextDocumentNotification, WillSaveTextDocumentNotification, WillSaveTextDocumentWaitUntilRequest, DidSaveTextDocumentNotification, DidCloseTextDocumentNotification, DidCreateFilesNotification, FileOperationRegistrationOptions, DidRenameFilesNotification, DidDeleteFilesNotification, WillCreateFilesRequest, WillRenameFilesRequest, WillDeleteFilesRequest, CompletionRequest, HoverRequest, SignatureHelpRequest, DefinitionRequest, ReferencesRequest, DocumentHighlightRequest, CodeActionRequest, DocumentFormattingRequest, DocumentRangeFormattingRequest, DocumentOnTypeFormattingRequest, RenameRequest, DocumentSymbolRequest, DocumentLinkRequest, DocumentColorRequest, DeclarationRequest, FoldingRangeRequest, ImplementationRequest, SelectionRangeRequest, TypeDefinitionRequest, CallHierarchyPrepareRequest, SemanticTokensRegistrationType, LinkedEditingRangeRequest, WorkspaceSymbolRequest, MessageSignature as MessageSignature$1, ProgressToken, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd, ClientCapabilities, ServerCapabilities, RegistrationType, FileEvent, ShowDocumentParams, ShowDocumentRequest, ShowDocumentResult, MessageConnection } from 'vscode-languageserver-protocol';
4
6
  import { CreateFilesParams, RenameFilesParams, DeleteFilesParams } from 'vscode-languageserver-protocol/lib/common/protocol.fileOperations';
5
- import { TextDocumentSaveReason as TextDocumentSaveReason$1, NotificationType as NotificationType$2, RequestType as RequestType$2 } from 'vscode-languageserver-protocol/lib/common/api';
6
7
  import * as monaco from 'monaco-editor';
7
8
 
8
9
  /**
@@ -7939,17 +7940,80 @@ declare namespace MonacoLanguageClient {
7939
7940
  }
7940
7941
  }
7941
7942
 
7943
+ interface WillShutdownParams {
7944
+ delay: number;
7945
+ }
7946
+
7942
7947
  declare type LanguageClientOptionsById<T extends string> = Record<T, LanguageClientOptions>;
7943
7948
  declare const staticOptions: LanguageClientOptionsById<"angular" | "bash" | "c" | "cpp" | "csharp" | "clojure" | "cobol" | "dart" | "go" | "groovy" | "java" | "javascript" | "kotlin" | "lua" | "mysql" | "sql" | "ocaml" | "php-serenata" | "php" | "postgresql" | "python" | "r" | "react" | "ruby" | "rust" | "scala" | "swift" | "typescript" | "verilog" | "vue">;
7944
7949
  declare type StaticLanguageClientId = keyof typeof staticOptions;
7945
7950
 
7946
7951
  declare type LanguageClientOptions = Pick<LanguageClientOptions$1, 'documentSelector' | 'synchronize' | 'initializationOptions' | 'middleware'> & {
7947
7952
  vscodeExtensionIds?: string[];
7953
+ /**
7954
+ * Is this language server mutualizable by the CodinGame mutualized proxy
7955
+ */
7948
7956
  mutualizable: boolean;
7957
+ /**
7958
+ * Maximum initialization duration. After this delay, the language server will be considered ready no matter what
7959
+ * default: 15_000
7960
+ */
7961
+ maxInitializeDuration?: number;
7962
+ /**
7963
+ * The language server will only be considered ready after this log message was received
7964
+ */
7965
+ readinessMessageMatcher?: RegExp;
7949
7966
  };
7950
7967
  declare function registerLanguageClient(id: string, options: LanguageClientOptions): Disposable;
7951
7968
  declare type LanguageClientId = StaticLanguageClientId | string;
7952
7969
 
7970
+ interface LanguageClient {
7971
+ sendNotification<P>(type: NotificationType$2<P>, params?: P): void;
7972
+ sendRequest<P, R, E>(request: RequestType$2<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
7973
+ }
7974
+ declare type Status = 'ready' | 'error' | 'connecting' | 'connected' | 'closed';
7975
+ interface StatusChangeEvent {
7976
+ status: Status;
7977
+ }
7978
+ declare class LanguageClientManager implements LanguageClient {
7979
+ private id;
7980
+ private languageServerOptions;
7981
+ private infrastructure;
7982
+ languageClient?: MonacoLanguageClient;
7983
+ private disposed;
7984
+ protected readonly onDidChangeStatusEmitter: Emitter<StatusChangeEvent>;
7985
+ protected readonly onErrorEmitter: Emitter<Error>;
7986
+ protected readonly onWillCloseEmitter: Emitter<void>;
7987
+ protected readonly onWillShutdownEmitter: Emitter<WillShutdownParams>;
7988
+ protected currentStatus: Status;
7989
+ private useMutualizedProxy;
7990
+ constructor(id: LanguageClientId, languageServerOptions: LanguageClientOptions, infrastructure: Infrastructure);
7991
+ private updateStatus;
7992
+ private notifyStatusChanged;
7993
+ isConnected(): boolean;
7994
+ dispose(): Promise<void>;
7995
+ get onDidChangeStatus(): Event<StatusChangeEvent>;
7996
+ get onWillClose(): Event<void>;
7997
+ get onWillShutdown(): Event<WillShutdownParams>;
7998
+ get onError(): Event<Error>;
7999
+ isModelManaged(document: TextDocument): boolean;
8000
+ isDisposed(): boolean;
8001
+ private handleClose;
8002
+ private handleError;
8003
+ start(): Promise<void>;
8004
+ private _start;
8005
+ sendNotification<P>(type: NotificationType$2<P>, params?: P): void;
8006
+ sendRequest<P, R, E>(type: RequestType$2<P, R, E>, params: P): Promise<R>;
8007
+ }
8008
+ /**
8009
+ * Create a language client manager
8010
+ * @param id The predefined id of the language client
8011
+ * @param infrastructure The infrastructure to use
8012
+ * @param parameters the infrastructure parameters
8013
+ * @returns A language client manager
8014
+ */
8015
+ declare function createLanguageClientManager(id: LanguageClientId, infrastructure: Infrastructure): LanguageClientManager;
8016
+
7953
8017
  interface Infrastructure {
7954
8018
  /**
7955
8019
  * Indicate if the file will be already up to date on the server or it it is required to send textDocument/save requests
@@ -7966,9 +8030,9 @@ interface Infrastructure {
7966
8030
  */
7967
8031
  workspaceFolders?: typeof workspace.workspaceFolders;
7968
8032
  /**
7969
- * The language server proxy is used, so we only need to load configurations for language servers which are not mutualized
8033
+ * Does a mutualization proxy will be used, it means we don't need to load configurations for this server
7970
8034
  */
7971
- useMutualizedProxy: boolean;
8035
+ useMutualizedProxy(languageClientId: LanguageClientId, options: LanguageClientOptions): boolean;
7972
8036
  /**
7973
8037
  * Save a file on the filesystem
7974
8038
  * @param document The document to save
@@ -7977,11 +8041,11 @@ interface Infrastructure {
7977
8041
  */
7978
8042
  saveFileContent?(document: TextDocument, reason: TextDocumentSaveReason$1, languageClient: LanguageClientManager): Promise<void>;
7979
8043
  /**
7980
- * Get a text file content
8044
+ * Get a text file content as a model
7981
8045
  * @param resource the Uri of the file
7982
8046
  * @param languageClient The languageclient we're trying to get the file from
7983
8047
  */
7984
- getFileContent(resource: monaco.Uri, languageClient: LanguageClientManager): Promise<string | null>;
8048
+ getFileContent(resource: monaco.Uri, languageClient: LanguageClientManager): Promise<monaco.editor.ITextModel | null>;
7985
8049
  /**
7986
8050
  * Open a connection to the language server
7987
8051
  * @param id The language server id
@@ -7993,7 +8057,7 @@ declare abstract class CodinGameInfrastructure implements Infrastructure {
7993
8057
  * The domain of the server
7994
8058
  */
7995
8059
  serverAddress: string;
7996
- useMutualizedProxy: boolean;
8060
+ private _useMutualizedProxy;
7997
8061
  /**
7998
8062
  * An optional sessionId when connecting to the session-mutualized server
7999
8063
  */
@@ -8006,7 +8070,7 @@ declare abstract class CodinGameInfrastructure implements Infrastructure {
8006
8070
  /**
8007
8071
  * The domain of the server
8008
8072
  */
8009
- serverAddress: string, useMutualizedProxy: boolean,
8073
+ serverAddress: string, _useMutualizedProxy: boolean,
8010
8074
  /**
8011
8075
  * An optional sessionId when connecting to the session-mutualized server
8012
8076
  */
@@ -8015,11 +8079,12 @@ declare abstract class CodinGameInfrastructure implements Infrastructure {
8015
8079
  * A list of urls which link to zip files containing libraries/resources
8016
8080
  */
8017
8081
  libraryUrls?: string[] | undefined);
8082
+ useMutualizedProxy(languageClientId: LanguageClientId, options: LanguageClientOptions): boolean;
8018
8083
  readonly automaticTextDocumentUpdate = false;
8019
8084
  readonly rootUri = "file:///tmp/project";
8020
8085
  readonly workspaceFolders: typeof workspace.workspaceFolders;
8021
8086
  saveFileContent(document: TextDocument, reason: TextDocumentSaveReason$1, languageClient: LanguageClientManager): Promise<void>;
8022
- getFileContent(resource: monaco.Uri, languageClient: LanguageClientManager): Promise<string | null>;
8087
+ getFileContent(resource: monaco.Uri, languageClient: LanguageClientManager): Promise<monaco.editor.ITextModel | null>;
8023
8088
  /**
8024
8089
  * A function which returns a valid JWT token to use to connect to the server
8025
8090
  */
@@ -8027,56 +8092,6 @@ declare abstract class CodinGameInfrastructure implements Infrastructure {
8027
8092
  openConnection(id: LanguageClientId): Promise<MessageConnection>;
8028
8093
  }
8029
8094
 
8030
- interface LanguageClient {
8031
- sendNotification<P>(type: NotificationType$2<P>, params?: P): void;
8032
- sendRequest<P, R, E>(request: RequestType$2<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
8033
- }
8034
- declare type Status = 'ready' | 'error' | 'connecting' | 'connected' | 'closed';
8035
- interface StatusChangeEvent {
8036
- status: Status;
8037
- }
8038
- declare class LanguageClientManager implements LanguageClient {
8039
- private id;
8040
- private languageServerOptions;
8041
- private infrastructure;
8042
- languageClient?: MonacoLanguageClient;
8043
- private disposed;
8044
- protected readonly onDidChangeStatusEmitter: Emitter<StatusChangeEvent>;
8045
- protected readonly onErrorEmitter: Emitter<Error>;
8046
- protected readonly onWillCloseEmitter: Emitter<void>;
8047
- protected readonly onWillShutdownEmitter: Emitter<WillShutdownParams>;
8048
- protected currentStatus: Status;
8049
- constructor(id: LanguageClientId, languageServerOptions: LanguageClientOptions, infrastructure: Infrastructure);
8050
- private updateStatus;
8051
- private notifyStatusChanged;
8052
- isReady(): boolean;
8053
- dispose(): Promise<void>;
8054
- get onDidChangeStatus(): Event<StatusChangeEvent>;
8055
- get onWillClose(): Event<void>;
8056
- get onWillShutdown(): Event<WillShutdownParams>;
8057
- get onError(): Event<Error>;
8058
- isModelManaged(document: TextDocument): boolean;
8059
- isDisposed(): boolean;
8060
- private handleClose;
8061
- private handleError;
8062
- start(): Promise<void>;
8063
- private _start;
8064
- sendNotification<P>(type: NotificationType$2<P>, params?: P): void;
8065
- sendRequest<P, R, E>(type: RequestType$2<P, R, E>, params: P): Promise<R>;
8066
- }
8067
- /**
8068
- * Create a language client manager
8069
- * @param id The predefined id of the language client
8070
- * @param infrastructure The infrastructure to use
8071
- * @param parameters the infrastructure parameters
8072
- * @returns A language client manager
8073
- */
8074
- declare function createLanguageClientManager(id: LanguageClientId, infrastructure: Infrastructure): LanguageClientManager;
8075
-
8076
- interface WillShutdownParams {
8077
- delay: number;
8078
- }
8079
-
8080
8095
  /**
8081
8096
  * Load the configuration schemas from vscode extensions
8082
8097
  * @param forLanguageClientIds Load the extensions related to these language client ids
@@ -8084,4 +8099,4 @@ interface WillShutdownParams {
8084
8099
  */
8085
8100
  declare function loadExtensionConfigurations(forLanguageClientIds: LanguageClientId[], useMutualizedProxy: boolean): Promise<void>;
8086
8101
 
8087
- export { CodinGameInfrastructure, Infrastructure, LanguageClientId, LanguageClientManager, StaticLanguageClientId, StatusChangeEvent, WillShutdownParams, WorkspaceFolder, createLanguageClientManager, loadExtensionConfigurations, registerLanguageClient };
8102
+ export { CodinGameInfrastructure, Infrastructure, LanguageClientId, LanguageClientManager, LanguageClientOptions, StaticLanguageClientId, StatusChangeEvent, TextDocument, WillShutdownParams, WorkspaceFolder, createLanguageClientManager, loadExtensionConfigurations, registerLanguageClient };