vscode: Investigation: do not restart Extension host when first folder changes

Today we restart the extension host whenever the first folder changes because workspace.rootPath is always set to that first folder and it never used to change after the extension host started once.

If we would not restart the extension host anymore an extension:

  • could use workspace.rootPath as before, it would still point to the first folder always (which can be undefined if the workspace contains no folders)
  • could subscribe to the onDidChangeWorkspaceFolders event to get notified about updates
  • would see the value of workspace.rootPath changing during runtime whenever the first folder changes

//cc @sandy081 @jrieken

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 16
  • Comments: 62 (54 by maintainers)

Commits related to this issue

Most upvoted comments

For the task improvement, I’ve opened https://github.com/microsoft/vscode/issues/90015. Let’s continue further tasks discussion there so we don’t derail the original issue.

Sorry, for the interrupt, a few cents from @PlatformIO => https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide

  1. 2019 was the worse year for VSCode. I’m personally fully disappointed. We spent a ton of effort just to working on workarounds in our extension. Almost every new release brought new problems for us. The 2017-2018 - were super progressive years. New APIs, quick bug fixing, amazing communication with extension providers.

  2. Do you monitor social channels? Do you see what developers now think about VSCode? Do you remember a time when each of us waits for a new VSCode release to see new features and improvements? What do we have today? I pray each day before VSCode’s new release in case it will no bring more problems for us.

  1. Who do need new icons? “cursor”, “highlights”? https://code.visualstudio.com/updates/v1_41 ? What is it? A ton of blocker issues and we work on new hotkeys? Did Microsoft change PMs for VSCode? It looks like YES!

  2. How many years do we need to instruct VSCode understanding Copy/Paste for macOS? https://github.com/platformio/platformio-vscode-ide/issues/606 . Just take a look at @mjbvz twitter account. Every week a new tweet about useless hotkeys… People have been asking for 1 year!!! please fix. No!

  3. Next surprise with the latest update. Instead of thinking about the developer’s workflow, VSCode thinks about machine performance. It asks developers to fully disable a task provider. How??? This is THE KEY component which drives the whole of our extension. See tons of public complaints https://community.platformio.org/t/pio-vsc-cant-build-no-tasks-found/10488 . You can’t imagine how many similar letters we receive in private support.

Yes, our task provider depends on reading platformio.ini file from the user machine and provides dynamic tasks. This is a super-fast operation and is fully asynchronous https://github.com/platformio/platformio-vscode-ide/blob/develop/src/tasks.js#L41


a) I know, this is an open-source and everyone can contribute. But! This is not a typical open source project. This is a strategic project by @Microsoft. The “open source” just only a screen before the further strategic business model.

b) Our extension is the most rated extension in the WHOLE marketplace. You can not imagine what is the price of these efforts. Do you know what we receive for promoting VSCode to a hundred thousand developers? NOTHING! We even don’t have minimal support where someone could help with fixing critical and blocker issues. I’ve never seen so high pride. I agree we are NOTHING in comparison with Microsoft. But you don’t understand one thing… If you want to create the best editor for everyone, you MUST TALK with Developers and Community.

c) We’ve already looking for a replacement for VSCode. The last year showed that VSCode is fully focused on JS/HTML/Icons/Hotkey coders and no one wants to discuss other perspectives of VSCode.

P.S: In any case, thanks for your efforts, especially for the 2016-2018 years!

P.S.S: Upcoming 1.42… 2 months since the last release! The MOST BLOCKER ISSUES were fixed:

  • "See pending renames in a diff… "
  • “Set the maximum number of editors open at one time”
  • " Move the panel (Output, Terminal) to the left, r"
  • " Quickly find folded regions "
  • … etc. etc.

I don’t have more comments.

If you cannot reserve time this milestone,

Since this is a high risk change I would not do anything else than gathering data this milestone. Maybe show an aggressive prompt when developing extensions that use this API.

Also adding @dbaeumer since I believe that the LSP-client has a reason to use the API (maybe not anymore?)

Relevant VS Code issue about copy/paste in webviews: #65452

@ivankravets In the future, when you have an issue you care about please just add a comment to the issue itself in a professional way (i.e. not attacking VS Code team members in unrelated issues like this one). And if you really care about an issue that doesn’t seem to be getting the attention you think it should, submit a PR

@alexr00 thanks for the comment.

I added the warning notification for slow task providers since it can result in a long wait

Task providers are dynamic components. So, as a minimum, VSCode knows which extension/component provides tasks. This warning would be more clear if you say that “these extensions depend on Tasks and they will not work”. I’m sure people will not disable task autodetection.

This is the same when we see a popup with “Do you accept our license?”. Only 1% of people read the full license text. There even do not suspect that they agree to kill “all elephants”.

@ivankravets please file a new issue if there isn’t one already, thanks.

I have merged the change to remove the ext host restarter. rootPath will be defined for a window with a folder or a workspace with a single folder, and undefined in any other case.

Added a deprecation warning for rootPath and will file a lot of issues on extensions later.