diff --git a/CHANGELOG.md b/CHANGELOG.md index ead936cd9..d0c95d4e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Changes to Calva. ## [Unreleased] +- [Add command for revealing the **Calva says** output channel](https://github.com/BetterThanTomorrow/calva/issues/2436) +- Fix: [Results not shown inline when output-channel configured is configured as for results output](https://github.com/BetterThanTomorrow/calva/issues/2437) +- [Make the results hover aware of where the results output goes](https://github.com/BetterThanTomorrow/calva/issues/2438) + ## [2.0.423] - 2024-03-17 - [Add Output Destinations configuration](https://github.com/BetterThanTomorrow/calva/issues/1104) diff --git a/docs/site/output.md b/docs/site/output.md index 70846315c..8be9da347 100644 --- a/docs/site/output.md +++ b/docs/site/output.md @@ -25,3 +25,10 @@ When Calva is connected to the REPL, the Output window will by default print not 3. Anything printed to `stdout` and `stderr` by the REPL process You can control the default via the `calva.redirectServerOutputToRepl` setting. It defaults to `true`. Setting it to `false` before connecting the REPL will result in that **2.** and **3.** will not get printed in the Output window. It will then instead be printed wherever the REPL process is printing its messages, usually the terminal from where it was started (the **Jack-in terminal** if Calva started the REPL). + +## Commands for showing output destinations + +These are the commands and their default keyboard shortcuts for revealing output destinations + +* **Calva: Show/Open the result output destination** - `ctrl+alt+o ctrl+o` +* **Calva: Show/Open the Calva says Output Channel** - `ctrl+alt+o o` \ No newline at end of file diff --git a/package.json b/package.json index 10e2f12af..27f68714e 100644 --- a/package.json +++ b/package.json @@ -1908,6 +1908,16 @@ "title": "Open Source File for Current Fiddle File", "enablement": "calva:activeEditorIsFiddle" }, + { + "category": "Calva", + "command": "calva.showOutputChannel", + "title": "Show/Open the Calva says Output Channel" + }, + { + "category": "Calva", + "command": "calva.showResultOutputDestination", + "title": "Show/Open the result output destination" + }, { "category": "Calva", "command": "calva.showOutputWindow", @@ -2613,6 +2623,16 @@ "key": "ctrl+alt+c f", "when": "calva:keybindingsEnabled && calva:activeEditorIsFiddle" }, + { + "command": "calva.showResultOutputDestination", + "key": "ctrl+alt+o ctrl+o", + "when": "calva:keybindingsEnabled" + }, + { + "command": "calva.showOutputChannel", + "key": "ctrl+alt+o o", + "when": "calva:keybindingsEnabled" + }, { "command": "calva.showOutputWindow", "key": "ctrl+alt+o r", diff --git a/src/extension.ts b/src/extension.ts index 680558675..c1327e226 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -270,6 +270,8 @@ async function activate(context: vscode.ExtensionContext) { }, showNextReplHistoryEntry: replHistory.showNextReplHistoryEntry, showOutputWindow: () => outputWindow.revealResultsDoc(false), + showOutputChannel: output.showOutputChannel, + showResultOutputDestination: output.showResultOutputDestination, showPreviousReplHistoryEntry: replHistory.showPreviousReplHistoryEntry, startJoyrideReplAndConnect: async () => { const projectDir: string = await joyride.prepareForJackingOrConnect(); diff --git a/src/providers/annotations.ts b/src/providers/annotations.ts index 849ed5e87..bdc20bbc0 100644 --- a/src/providers/annotations.ts +++ b/src/providers/annotations.ts @@ -133,8 +133,8 @@ function decorateSelection( JSON.stringify([{ text: resultString }]) )}`, copyCommandMd = `[Copy](${copyCommandUri} "Copy results to the clipboard")`; - const openWindowCommandUri = `command:calva.showOutputWindow`, - openWindowCommandMd = `[Open Output Window](${openWindowCommandUri} "Open the output window")`; + const openWindowCommandUri = `command:calva.showResultOutputDestination`, + openWindowCommandMd = `[Show Output](${openWindowCommandUri} "Reveal the output destination")`; const hoverMessage = new vscode.MarkdownString( `${copyCommandMd} | ${openWindowCommandMd}\n` + '```clojure\n' + resultString + '\n```' ); diff --git a/src/results-output/output.ts b/src/results-output/output.ts index c947451d5..b5d7c6a3b 100644 --- a/src/results-output/output.ts +++ b/src/results-output/output.ts @@ -12,6 +12,18 @@ export function initOutputChannel(channel: vscode.OutputChannel) { outputChannel = channel; } +export function showOutputChannel() { + outputChannel.show(true); +} + +export function showResultOutputDestination() { + if (getDestinationConfiguration().evalResults === 'output-channel') { + return showOutputChannel(); + } else { + return outputWindow.revealResultsDoc(true); + } +} + export type OutputDestination = 'repl-window' | 'output-channel'; export type OutputDestinationConfiguration = { @@ -56,7 +68,7 @@ function appendClojure( outputChannel.appendLine( (didLastTerminateLine ? '' : '\n') + '```clojure\n' + message + '\n```' ); - // TODO: Deal with `after` + after(undefined, undefined); return; } }