question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension Activation on web is not fired for each local folder opened

See original GitHub issue

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: web
  • OS Version: MacOS Big Sur / MSEdge and Safari

Steps to Reproduce:

Maybe. I’m missing something, but it seems the extension activation in web extensions works a bit different compared to desktop.

I mean, in desktop, the regular activate function is fired every time a workspace is opened, respecting of course what you defined in activationEvents. which in my case, is * yet. In web (http://vscode.dev to be more precise), it seems the extension is activated only once when you navigate to http://vscode.dev. And no matter how many local folders you open, the activate function is not called anymore.

I’m using the side load approach to test my extension in web, and noticed this behavior because I use workspaceFolders while in the activation event to manage some data used on my extension. In web, this is returning undefined, even after I opened some local folder.

I didn’t find any documentation nor any issue that points to this behavior, so I wonder I’m doing something wrong.

On the other hand, I could see the onDidChangeWorkspaceFolders being fired when you open a different folder, but based on API Docs, this event should be fired only when you add/remove some folder from a workspace.

Also, I’m not sure another issue is being caused by the side load approach (just like debugging extensions does) but the activationEvents is not being respected on web. I changed my extension to workspaceContains:somefile and it was activated even on an empty workspace.

Thank you

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
alefragnanicommented, Apr 8, 2022

Yeah…as I said, maybe I’m mistaken. In this case, I probably am 😆

1reaction
bpaserocommented, Apr 8, 2022

To clarify: we only force an empty MR workspace onto you for when you open vscode.dev / insiders.vscode.dev. Once you go to a remote, that changes.

In other words, in web, without a server, the empty window experience is that empty MR workspace where you can open local folders in if the browser supports that. And when you do, immediately the first folder will change and thus most likely restart the extension host.

On desktop, when you open a folder, the window reloads into that folder.

So yeah, there is a difference.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code not activating extensions - Stack Overflow
I fix it doing a complete uninstall of VS Code: Use the uninstall: "%USERPROFILE%/AppData/Local/Programs/Microsoft VS Code/uninst000.exe".
Read more >
Managing Extensions in Visual Studio Code
Discover, add, update, disable and uninstall Visual Studio Code extensions (plug-ins) through the Extension Marketplace.
Read more >
Fixes or workarounds for recent issues in Outlook for PC
Jump to each section on this page for specific Outlook issue: Outlook issues after connecting Outlook to Outlook.com. Outlook known issues in the...
Read more >
How to make Dropbox files online-only
However, those files will no longer appear in the Dropbox folder on your computer. Set files you add to web to online-only by...
Read more >
Working with files - MDN Web Docs - Mozilla
Downloading files to the user's selected download folder. · Opening files using a file picker on a web page. · Opening files using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found