vscode-clockify
vscode-clockify copied to clipboard
Add quick toggle button to statusbar
It'd be nice if the existing statusbar icon toggled the timer. I've been working on tweaking the extension to add it myself, and have successfully made it start a timer, but I'm struggling at the moment with detecting state to allow it to stop a running timer. Seems I can't access context from within the openStatusBarMenu() function and I haven't been able to figure out how to add it... yet.
Can't you do
context.subscriptions.push(
vscode.commands.registerCommand('clockify.statusbar.menu', () => openStatusBarMenu(context))
);
And change the openStatusBarMenu definition to
export function openStatusBarMenu(context:vscode.ExtensionContext) ?
Tried basically that, and tried this as well:
context.subscriptions.push(vscode.commands.registerCommand('clockify.statusbar.menu', () => {
openStatusBarMenu(context);
}));
Neither worked (both throw TypeError: Cannot read property 'globalState' of undefined). I'll admit, I'm way out of my depth trying to work with Node 😛
If you want look at my fork of the plugin. But for now it's only workable in dev mode.
As mentioned in #19 I am working on it. Version 4 of the extension is coming soon :)