Add a 'open server logs' button to the error notification

This commit is contained in:
Lukas Wirth
2023-01-23 13:10:25 +01:00
parent 84239a1454
commit b9fe5afb30
7 changed files with 58 additions and 12 deletions

View File

@@ -316,6 +316,7 @@ class ExperimentalFeatures implements lc.StaticFeature {
caps.hoverActions = true;
caps.serverStatusNotification = true;
caps.colorDiagnosticOutput = true;
caps.openServerLogs = true;
caps.commands = {
commands: [
"rust-analyzer.runSingle",

View File

@@ -187,6 +187,11 @@ export class Ctx {
this.setServerStatus(params)
)
);
this.pushClientCleanup(
this._client.onNotification(ra.openServerLogs, () => {
this.outputChannel!.show();
})
);
}
return this._client;
}

View File

@@ -21,6 +21,7 @@ export interface ServerStatusParams {
export const serverStatus = new lc.NotificationType<ServerStatusParams>(
"experimental/serverStatus"
);
export const openServerLogs = new lc.NotificationType0("rust-analyzer/openServerLogs");
export const reloadWorkspace = new lc.RequestType0<null, void>("rust-analyzer/reloadWorkspace");