Skip to content
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

Limit extension activation events #52

Merged

Conversation

anton-matosov
Copy link
Contributor

Currently activation event is set to * which makes extension always active.
This results in extension always showing Micromamba: Open a folder or a workspace on startup
And extension will attempt to activate for every workspace even if it has no environment file consuming memory and CPU.

Extension packaging with vcse confirms this with the following warning:

 WARNING  Using '*' activation is usually a bad idea as it impacts performance.
More info: https://code.visualstudio.com/api/references/activation-events#Start-up

By limiting activationEvents to workspaceContains:environment*.{yml,yaml} extension will remain out of memory unless there is an environment file it can read to activate it. All the commands extension provides are still available and extension will be activate upon command execution:

2024-07-24 18:43:22.918 [info] ExtensionService#_doActivateExtension corker.vscode-micromamba, startup: false, activationEvent: 'onCommand:corker.micromamba.activate.environment.by.path'

Currently activation event is set to `*` which makes extension always active.
This results in extension always showing `Micromamba: Open a folder or a workspace` on startup
And extension will attempt to activate for every workspace even if it has no environment file consuming memory and CPU.

Extension packaging with `vcse` confirms this with the following warning:
```
 WARNING  Using '*' activation is usually a bad idea as it impacts performance.
More info: https://code.visualstudio.com/api/references/activation-events#Start-up
```

By limiting `activationEvents` to `workspaceContains:environment*.{yml,yaml}` extension will remain out of memory unless there is an environment file it can read to activate it. All the commands extension provides are still available and extension will be activate upon command execution:
```
2024-07-24 18:43:22.918 [info] ExtensionService#_doActivateExtension corker.vscode-micromamba, startup: false, activationEvent: 'onCommand:corker.micromamba.activate.environment.by.path'
```
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10086736042

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 58.09%

Totals Coverage Status
Change from base Build 9595185128: 0.0%
Covered Lines: 394
Relevant Lines: 616

💛 - Coveralls

@corker corker merged commit 80922b5 into mamba-org:main Aug 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants