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

Activate extension with workspaceContains when a matching file is added to the workspace #28122

Open
roblourens opened this issue Jun 6, 2017 · 5 comments
Labels
api feature-request Request for new features or functionality
Milestone

Comments

@roblourens
Copy link
Member

If I have "workspaceContains:**/*.md" as an activationEvent, it would be useful for it to fire when a matching file is added to the workspace, not just when a workspace with matching file is opened.

#27665 (comment)

@1nVitr0
Copy link

1nVitr0 commented Mar 15, 2021

Are there any plans to implement this?

I'd rather not have my extension running permanently to figure out if it can be activated. This would be the far better solution regarding performance.

@JustinGrote
Copy link
Contributor

As a workaround, you can lazy-load extensions now, so you can lazy load just the detection logic and active that rest on detection change.

Ideally this is first party handled by vscode however.

@1nVitr0
Copy link

1nVitr0 commented Jul 27, 2023

I was thrown for a loop by the now. You mean, that this has always been possible and can be implemented in any extension, regardless of the state of the vscode API?

@JustinGrote
Copy link
Contributor

@1nVitr0 https://code.visualstudio.com/api/references/activation-events#onStartupFinished

onStartupFinished can be used to lazy load an extension in a way that minimizes vscode startup performance.

@1nVitr0
Copy link

1nVitr0 commented Jul 28, 2023

@JustinGrote Right, that makes total sense. If combined with the proper workspaceContains selector, that should allow the extension to load immediately if necessary or listen for the files without impacting startup performance. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants