ワンクリックで
vscode-status-bar-coordination
Pattern for coordinating VS Code status bar updates with tree view and data provider refresh cycles
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Pattern for coordinating VS Code status bar updates with tree view and data provider refresh cycles
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Pattern for VS Code tree views that consume optional services with graceful degradation
Patterns for building dashboard webviews with tabs and visualizations
{what this skill teaches agents}
Lightweight YAML frontmatter extraction from markdown files without external dependencies
Pattern for building Node.js API clients with TTL-based caching and no external dependencies
CI pipeline patterns for VS Code extensions using GitHub Actions
| name | vscode-status-bar-coordination |
| description | Pattern for coordinating VS Code status bar updates with tree view and data provider refresh cycles |
| domain | vscode-extensions |
| confidence | low |
| source | earned |
VS Code extensions with tree views often need a companion status bar item to provide at-a-glance information. The status bar should stay synchronized with tree data and update whenever the underlying data changes (file watcher events, user commands, data provider refreshes).
Both the tree provider and status bar should consume the same data provider instance. This ensures consistency and avoids duplicate data fetching.
const dataProvider = new SquadDataProvider(workspaceRoot);
const treeProvider = new SquadTreeProvider(dataProvider);
const statusBar = new SquadStatusBar(dataProvider);
Every code path that triggers a tree refresh should also update the status bar. This includes:
// File watcher coordination
fileWatcher.onFileChange(() => {
treeProvider.refresh();
statusBar?.update();
});
// Command coordination
vscode.commands.registerCommand('myext.refresh', () => {
dataProvider.refresh();
treeProvider.refresh();
statusBar?.update();
});
Status bar items must be disposed when the extension deactivates. Track the instance and include it in the deactivate cleanup.
let statusBar: MyStatusBar | undefined;
export function activate(context: vscode.ExtensionContext) {
statusBar = new MyStatusBar(dataProvider);
context.subscriptions.push(statusBar);
}
export function deactivate() {
statusBar?.dispose();
}
Use vscode.MarkdownString for status bar tooltips to provide structured, multi-line details that complement the compact status bar text.
const tooltip = new vscode.MarkdownString();
tooltip.appendMarkdown(`**Status Summary**\n\n`);
tooltip.appendMarkdown(`Active: ${count}\n\n`);
this.statusBarItem.tooltip = tooltip;
Use emoji or themed icons in status bar text for immediate visual feedback. Emoji work across all themes without custom icon management.
// Health indicator example
private getHealthIcon(activeCount: number, total: number): string {
const ratio = activeCount / total;
if (ratio >= 0.7) return '🟢';
if (ratio >= 0.3) return '🟡';
return '🟠';
}
this.statusBarItem.text = `$(icon) Status: ${count} ${this.getHealthIcon(count, total)}`;