MCPcopy
hub / github.com/microsoft/vscode-languageserver-node / start

Function start

client/src/client.ts:2497–2574  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2495 }
2496
2497 public start(): Disposable {
2498 this._listeners = [];
2499 this._providers = [];
2500 // If we restart then the diagnostics collection is reused.
2501 if (!this._diagnostics) {
2502 this._diagnostics = this._clientOptions.diagnosticCollectionName
2503 ? Languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName)
2504 : Languages.createDiagnosticCollection();
2505 }
2506
2507 this.state = ClientState.Starting;
2508 this.resolveConnection().then((connection) => {
2509 connection.onLogMessage((message) => {
2510 switch (message.type) {
2511 case MessageType.Error:
2512 this.error(message.message);
2513 break;
2514 case MessageType.Warning:
2515 this.warn(message.message);
2516 break;
2517 case MessageType.Info:
2518 this.info(message.message);
2519 break;
2520 default:
2521 this.outputChannel.appendLine(message.message);
2522 }
2523 });
2524 connection.onShowMessage((message) => {
2525 switch (message.type) {
2526 case MessageType.Error:
2527 Window.showErrorMessage(message.message);
2528 break;
2529 case MessageType.Warning:
2530 Window.showWarningMessage(message.message);
2531 break;
2532 case MessageType.Info:
2533 Window.showInformationMessage(message.message);
2534 break;
2535 default:
2536 Window.showInformationMessage(message.message);
2537 }
2538 });
2539 connection.onRequest(ShowMessageRequest.type, (params) => {
2540 let messageFunc: <T extends MessageItem>(message: string, ...items: T[]) => Thenable<T>;
2541 switch (params.type) {
2542 case MessageType.Error:
2543 messageFunc = Window.showErrorMessage;
2544 break;
2545 case MessageType.Warning:
2546 messageFunc = Window.showWarningMessage;
2547 break;
2548 case MessageType.Info:
2549 messageFunc = Window.showInformationMessage;
2550 break;
2551 default:
2552 messageFunc = Window.showInformationMessage;
2553 }
2554 let actions = params.actions || [];

Callers

nothing calls this directly

Calls 14

onLogMessageMethod · 0.80
onShowMessageMethod · 0.80
onTelemetryMethod · 0.80
fireMethod · 0.80
stopMethod · 0.80
errorMethod · 0.65
warnMethod · 0.65
infoMethod · 0.65
showErrorMessageMethod · 0.65
showWarningMessageMethod · 0.65
onRequestMethod · 0.65

Tested by

no test coverage detected