From ace08f6a8b1f4d173e2af588e04b5f52efb5acce Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Fri, 4 Apr 2025 11:12:46 -0400 Subject: [PATCH] Report language server exiting with unsaved changes as 'java.ls.error'. Signed-off-by: Roland Grunberg --- src/standardLanguageClient.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/standardLanguageClient.ts b/src/standardLanguageClient.ts index 2eaed4fbdc..aebeee951e 100644 --- a/src/standardLanguageClient.ts +++ b/src/standardLanguageClient.ts @@ -343,16 +343,22 @@ export class StandardLanguageClient { } else if (e.name === Telemetry.LS_ERROR) { const tags = []; const exception: string = e?.properties.exception; + const message: string = e?.properties.message; if (exception !== undefined) { if (exception.includes("dtree.ObjectNotFoundException")) { tags.push("dtree.ObjectNotFoundException"); } - - if (tags.length > 0) { - e.properties['tags'] = tags; - return Telemetry.sendTelemetry(Telemetry.LS_ERROR, e.properties); + } + if (message !== undefined) { + if (message.includes("workspace exited with unsaved changes")) { + tags.push("workspace-exited-unsaved-changes"); } } + + if (tags.length > 0) { + e.properties['tags'] = tags; + return Telemetry.sendTelemetry(Telemetry.LS_ERROR, e.properties); + } } });