-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize extension activation #22
Comments
The reason I went with Additionally, CodeSwing exports an API for other extensions to use (e.g. GistPad), and since there's no activation event for other extensions trying to use your API, these consumers would need to manually check if CodeSwing was activated, and if not, activate it. That's definitely not difficult to do, but I wanted to keep things simple since this extension is super new, and I'm exploring integrations with various folks. Since the Out of curiosity: are you seeing CodeSwing impact your startup time? Or did you just see the activation event in the extension details page? I'll do some profiling to see how to further streamline startup, since it should be pretty negligible. And I'll play around with |
Hey @lostintangent thats fair enough and thanks for your reply! I haven’t noticed any impact but I thought it was worth pointing out as when a few extensions do this it can start to build up. Some other extensions switched to onStartupFinished and didn’t notice any impact but I’ll leave that for you to experiment. |
Yep totally agreed. I may be able to achieve a startup experience that's optimized for the majority of scenarios, and then relies on onStartupFinished as a "fallback". |
Just pushed an extension update that activates using |
That’s awesome! |
Hey this extension looks great!
For activationEvents try to avoid using
*
. Using*
means this extension will startup and activate even if someone is not using it. It will also incur a (albeit small) startup cost for users.As this extension seems to be command driven you can put the commands in there instead, that way it won't slow down performance when not in use. More info here:
https://code.visualstudio.com/api/references/activation-events#Start-up
I'm not sure how you detect this but you can have the extension activate if a certain file is in the workspace (there's an example of that here) or if there's really other option
onStartupFinished
may be betterThe text was updated successfully, but these errors were encountered: