gistpad
gistpad copied to clipboard
If possible, don't activate on onStartupFinished
When you are onStartupFinished
activated, you activate every single time, even if the user has no intention of using the extension. I don't exclusively work in Gists so all of those times I'm not working in Gists, GistPad is activated for nothing which does introduce memory pressure and slows down VS Code.
It's better to be reactive and only activate when the user interacts with your extension:
- via a command
- via a view being visible
To Reproduce Steps to reproduce the behavior:
- Go to vscode.dev
- install gistpad
- reload the window
- gistpad is activated
Expected behavior It shouldn't activate until needed.
Additional context The line in the package.json is here: https://github.com/lostintangent/gistpad/blob/master/package.json#L63
Activation events for your reference (even though I know you know where these are) https://code.visualstudio.com/api/references/activation-events
Hey @TylerLeonhardt, please check this PR comment as to why we removed actication on *
and added onStartupFinished
.
Do you have suggestions about how to display the status bar items without using onStartupFinished
?
I read the Wiki's section in the readme... it looks like these status bars are added when:
- The folder is named
foo-wiki
- The folder contains a
gistpad.json
or afoam.json
The latter can be easily triggered with: "workspaceContains:**/gistpad.json"
and "workspaceContains:**/foam.json"
activation events.
The former isn't possible at this time... but IMO, if that is really the only thing keeping onStartupFinished
... then it doesn't seem worth it. The user is likely to hit one of the other activation events.
a workaround would be to have a separate extension called
GistPad Wiki's
that isonStartupFinished
activated that simply activates GistPad.
if there's an extension that will likely also be installed in this
foo-wiki
scenario and it contributes a view/webview, maybe you could use that activation event
Actually I'm not sure... I think trying workspaceContains:*-wiki
for the former case might be worth trying but I doubt it works.