Skip to content

Commit

Permalink
feat(workspace): add parameter to command 'workspace.showOutput' (#5014)
Browse files Browse the repository at this point in the history
* fix bug: patchLine, byte aligned

* Add parameter to command 'workspace.showOutput'
  • Loading branch information
solomonwzs committed May 20, 2024
1 parent 2c7e715 commit d33fbed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/handler/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ export default class WorkspaceHandler {
}, false, 'Generates a snapshot of the current V8 heap and writes it to a JSON file.')
commands.register({
id: 'workspace.showOutput',
execute: async (name?: string) => {
execute: async (name?: string, cmd?: string) => {
if (!name) name = await window.showQuickPick(workspace.channelNames, { title: 'Choose output name' }) as string
window.showOutputChannel(toText(name))
window.showOutputChannel(toText(name), cmd)
}
}, false, 'open output buffer to show output from languageservers or extensions.')
commands.register({
Expand Down
5 changes: 3 additions & 2 deletions src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ export class Window {
* Reveal buffer of output channel.
*
* @param name Name of output channel.
* @param cmd command for open output channel.
* @param preserveFocus Preserve window focus when true.
*/
public showOutputChannel(name: string, preserveFocus?: boolean): void {
let command = this.configuration.get<string>('workspace.openOutputCommand', 'vs')
public showOutputChannel(name: string, cmd?: string, preserveFocus?: boolean): void {
let command = cmd ? cmd : this.configuration.get<string>('workspace.openOutputCommand', 'vs')
channels.show(name, command, preserveFocus)
}

Expand Down

0 comments on commit d33fbed

Please sign in to comment.