vscode-clockify icon indicating copy to clipboard operation
vscode-clockify copied to clipboard

Add quick toggle button to statusbar

Open evertiro opened this issue 6 years ago • 3 comments
trafficstars

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.

evertiro avatar Oct 29 '19 21:10 evertiro

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) ?

azertyalex avatar Oct 29 '19 22:10 azertyalex

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 😛

evertiro avatar Oct 29 '19 23:10 evertiro

If you want look at my fork of the plugin. But for now it's only workable in dev mode.

azertyalex avatar Oct 30 '19 02:10 azertyalex

As mentioned in #19 I am working on it. Version 4 of the extension is coming soon :)

tobiaswaelde avatar Feb 16 '23 00:02 tobiaswaelde