Skip to content

Commit aeace9d

Browse files
authored
Merge pull request #854 from Lemoncode/feature/#852-create-wireframe-button-on-status-bar
Feature/#852 create wireframe button on status bar
2 parents 6b15dd4 + 58f5895 commit aeace9d

7 files changed

Lines changed: 50 additions & 0 deletions

File tree

.changeset/three-mirrors-begin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'quickmock': minor
3+
---
4+
5+
Added create new wireframe button on VSCode status bar.

packages/vscode-extension/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registerCommands } from '#commands';
22
import { onAppUrlChange, syncAppUrlFile } from '#core';
33
import { QuickMockEditorProvider } from '#editor';
44
import { setupMcp } from '#mcp';
5+
import { registerStatusBarItems } from '#status-bar';
56
import * as vscode from 'vscode';
67

78
export const activate = (context: vscode.ExtensionContext) => {
@@ -10,6 +11,7 @@ export const activate = (context: vscode.ExtensionContext) => {
1011
context.subscriptions.push(QuickMockEditorProvider.register(context));
1112
setupMcp(context);
1213
registerCommands(context);
14+
registerStatusBarItems(context);
1315
};
1416

1517
export const deactivate = () => {};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './new-wireframe';
2+
export * from './register';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './new-wireframe.status-bar';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const STATUS_BAR_PRIORITY = 100;
2+
export const ITEM_TEXT = '$(lightbulb) Quickmock';
3+
export const ITEM_TOOLTIP = 'Create new Quickmock wireframe';
4+
export const ITEM_COLOR_THEME_TOKEN = 'statusBar.foreground';
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { QUICKMOCK_NEW_WIREFRAME_COMMAND_ID } from '#commands';
2+
import * as vscode from 'vscode';
3+
import {
4+
ITEM_COLOR_THEME_TOKEN,
5+
ITEM_TEXT,
6+
ITEM_TOOLTIP,
7+
STATUS_BAR_PRIORITY,
8+
} from './new-wireframe.consts';
9+
10+
export const registerNewWireframeStatusBarItem = (
11+
context: vscode.ExtensionContext
12+
): void => {
13+
const item = vscode.window.createStatusBarItem(
14+
vscode.StatusBarAlignment.Left,
15+
STATUS_BAR_PRIORITY
16+
);
17+
item.text = ITEM_TEXT;
18+
item.tooltip = ITEM_TOOLTIP;
19+
item.color = new vscode.ThemeColor(ITEM_COLOR_THEME_TOKEN);
20+
item.command = QUICKMOCK_NEW_WIREFRAME_COMMAND_ID;
21+
item.show();
22+
23+
context.subscriptions.push(item);
24+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as vscode from 'vscode';
2+
import { registerNewWireframeStatusBarItem } from './new-wireframe';
3+
4+
/**
5+
* Registers all VS Code status bar items exposed by the extension.
6+
* @param context The VS Code extension context.
7+
*/
8+
export const registerStatusBarItems = (
9+
context: vscode.ExtensionContext
10+
): void => {
11+
registerNewWireframeStatusBarItem(context);
12+
};

0 commit comments

Comments
 (0)