Skip to content

Commit 4c79bae

Browse files
authored
remove notification asking for error collection (#942)
Signed-off-by: Yan Zhang <[email protected]>
1 parent cea2d85 commit 4c79bae

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/daemon/processWatcher.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,7 @@ export class ProcessWatcher {
9797
name: "jdtls-last-heartbeat",
9898
message: lastHeartbeat!
9999
});
100-
const consentToCollectLogs = vscode.workspace.getConfiguration("java").get<boolean>("help.shareDiagnostics");
101-
if (!consentToCollectLogs) {
102-
vscode.window.showInformationMessage("Java Language Server is crashed. Do you want to share error logs with us for diagnostic purpose?", "Yes").then(choice => {
103-
if (choice) {
104-
vscode.workspace.getConfiguration("java").update("help.shareDiagnostics", true);
105-
this.daemon.logWatcher.sendErrorAndStackOnCrash();
106-
}
107-
});
108-
}
100+
this.daemon.logWatcher.sendErrorAndStackOnCrash();
109101
}
110102
}
111103

src/daemon/serverLog/logWatcher.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,17 @@ export class LogWatcher {
8787
if (this.serverLogUri){
8888
const logs = await logsForLatestSession(path.join(this.serverLogUri?.fsPath, ".log"));
8989
const errors = collectErrors(logs);
90+
const consentToCollectLogs = vscode.workspace.getConfiguration("java").get<boolean>("help.shareDiagnostics");
9091
if (errors) {
9192
errors.forEach(e => {
92-
sendInfo("", {
93+
consentToCollectLogs ? sendInfo("", {
9394
name: "jdtls-error-in-crashed-session",
9495
error: e.message,
9596
stack: e.stack!,
9697
timestamp: e.timestamp!.toString()
98+
}) : sendInfo("", {
99+
name: "jdtls-error-in-crashed-session",
100+
timestamp: e.timestamp!.toString()
97101
});
98102
})
99103
}

0 commit comments

Comments
 (0)