Skip to content

Commit

Permalink
Remove click handler from status bar and add schema switch command to…
Browse files Browse the repository at this point in the history
… command palette
  • Loading branch information
trevor-scheer committed Oct 19, 2018
1 parent d0a34ef commit 6920ea2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 6 additions & 1 deletion packages/apollo-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
"meta.embedded.block.graphql": "graphql"
}
}
]
],
"commands": [{

This comment has been minimized.

Copy link
@jbaxleyiii

jbaxleyiii Oct 19, 2018

Contributor

This is amazing how clean of an addition it makes

"command": "apollographql/selectSchemaTag",
"title": "Select Schema Tag",
"category": "Apollo"
}]
}
}
3 changes: 1 addition & 2 deletions packages/apollo-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ export function activate(context: ExtensionContext) {
);

schemaTags = [...quickPickItems, ...schemaTags];
statusBar.enableClickHandler(true);
}
);

commands.registerCommand("launchSchemaTagPicker", async () => {
commands.registerCommand("apollographql/selectSchemaTag", async () => {
const selection = await window.showQuickPick(schemaTags);
if (selection) {
client.sendNotification("apollographql/tagSelected", selection);
Expand Down
7 changes: 0 additions & 7 deletions packages/apollo-vscode/src/statusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ export default class ApolloStatusBar {
this.statusBarItem.show();
}

public enableClickHandler(isEnabled: boolean) {
this.statusBarItem.tooltip = isEnabled ? "Select schema tag" : undefined;
this.statusBarItem.command = isEnabled
? "launchSchemaTagPicker"
: undefined;
}

public dispose() {
this.statusBarItem.dispose();
}
Expand Down

0 comments on commit 6920ea2

Please sign in to comment.