Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 154a1eb

Browse files
ortaacao
authored andcommitted
Adds support for making clicking on the graphql status item show the output channel
1 parent 4a70cb8 commit 154a1eb

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,19 @@
194194
"commands": [
195195
{
196196
"command": "vscode-graphql.isDebugging",
197-
"title": "VSCode GraphQL - Is Debugging?"
197+
"title": "VSCode GraphQL: Is Debugging?"
198198
},
199199
{
200200
"command": "vscode-graphql.restart",
201-
"title": "VSCode GraphQL - Manual Restart"
201+
"title": "VSCode GraphQL: Manual Restart"
202+
},
203+
{
204+
"command": "vscode-graphql.showOutputChannel",
205+
"title": "VSCode GraphQL: Show output channel"
202206
},
203207
{
204208
"command": "vscode-graphql.contentProvider",
205-
"title": "Execute GraphQL Operations"
209+
"title": "VSCode GraphQL: Execute GraphQL Operations"
206210
}
207211
]
208212
},

src/extension.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ export function activate(context: ExtensionContext) {
113113
)
114114
context.subscriptions.push(commandIsDebugging)
115115

116+
const commandShowOutputChannel = commands.registerCommand(
117+
"vscode-graphql.showOutputChannel",
118+
() => {
119+
outputChannel.show()
120+
},
121+
)
122+
context.subscriptions.push(commandShowOutputChannel)
123+
116124
// Manage Status Bar
117125
context.subscriptions.push(statusBarItem)
118126
client.onReady().then(() => {

src/status/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ function updateStatusBar(
8383
statusBarItem: StatusBarItem,
8484
editor: TextEditor | undefined,
8585
) {
86-
extensionStatus = serverRunning ? Status.RUNNING : Status.ERROR
86+
extensionStatus = serverRunning ? Status.RUNNING : Status.ERROR;
8787

88-
const statusUI = statusBarUIElements[extensionStatus]
89-
statusBarItem.text = `$(${statusUI.icon}) ${statusBarText}`
90-
statusBarItem.tooltip = statusUI.tooltip
91-
statusBarItem.command = "vscode-graphql.isDebugging"
88+
const statusUI = statusBarUIElements[extensionStatus];
89+
statusBarItem.text = `$(${statusUI.icon}) ${statusBarText}`;
90+
statusBarItem.tooltip = statusUI.tooltip;
91+
statusBarItem.command = "vscode-graphql.showOutputChannel";
9292
if ("color" in statusUI) statusBarItem.color = statusUI.color
9393

9494
if (

0 commit comments

Comments
 (0)