microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.47k stars 29.36k forks source link

User-Defined Activation Events for Extensions #233187

Open mattorp opened 1 week ago

mattorp commented 1 week ago

Allow users to set custom activation events in settings.json for each extension, independent of the extension’s package.json. For instance:

"extensions.activationOverrides": {
    "git-graph": {
        "activationEvents": ["onCommand:git-graph.view:showGraph"]
    }
}

This would allow users to define custom activation events for VSCode extensions. Currently, the activation of an extension is determined by predefined events specified in the extension’s package.json (such as onStartupFinished, onCommand:, etc.). However, there are many cases where a user might want more control over these events to prevent certain extensions from running until explicitly needed.

For example, I have extensions like Git Graph, which I use occasionally, but not enough to justify having it always active. I prefer it to activate only when I run a specific command, such as “Show Graph.” This would reduce resource usage and streamline the extension experience in VSCode.

amunger commented 1 week ago

@joyceerhl - git graph is star activated, and I remember you doing some work to try and reduce those.

vs-code-engineering[bot] commented 1 week ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

joyceerhl commented 1 week ago

@isidorn have we reached out to Git Graph re: their * activation usage?

isidorn commented 6 days ago

No. Their last commit is from 3 years ago. But let me send them an email and cc you