diff options
| author | bors <bors@rust-lang.org> | 2023-01-23 12:25:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-23 12:25:04 +0000 |
| commit | ed88fd4ec404e6675bb9e0b538bed2d1e5436f18 (patch) | |
| tree | 88b5937a91eeaea0eb80c66aa881412bcf3f55cf /editors/code/src | |
| parent | e1d7a71bcc42c10c1c7a77197c19bd4f1acfbcd8 (diff) | |
| parent | b9fe5afb30d00e14aaf5d02ff12a74efb774d4f1 (diff) | |
| download | rust-ed88fd4ec404e6675bb9e0b538bed2d1e5436f18.tar.gz rust-ed88fd4ec404e6675bb9e0b538bed2d1e5436f18.zip | |
Auto merge of #14007 - Veykril:open-server-logs, r=Veykril
Add a 'open server logs' button to the error notification Closes https://github.com/rust-lang/rust-analyzer/issues/13995#issuecomment-1399669561 
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/client.ts | 1 | ||||
| -rw-r--r-- | editors/code/src/ctx.ts | 5 | ||||
| -rw-r--r-- | editors/code/src/lsp_ext.ts | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 1fbe9d4ea03..9335e9abb30 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -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", diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index d6cee5c8fc6..1860924c6de 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -187,6 +187,11 @@ export class Ctx { this.setServerStatus(params) ) ); + this.pushClientCleanup( + this._client.onNotification(ra.openServerLogs, () => { + this.outputChannel!.show(); + }) + ); } return this._client; } diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 29349cc20f5..6ddf83799c0 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -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"); |
