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

Provide the ability to specify dependencies on a per-platform basis #136231

Closed
brettcannon opened this issue Nov 1, 2021 · 9 comments
Closed
Assignees
Labels
extensions Issues concerning extensions *out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach

Comments

@brettcannon
Copy link
Member

It would be great if an extension's depedencies could be platform-specific. For instance, the Python extension has Pylance as an optional dependency. But on the web, having Pylance be optional doesn't make sense as it provides all features for the Python extension on that platform.

We contemplated creating a custom package.json for the web platform, but Settings Sync in this situation would lead to an issue for users who chose to uninstall Pylance on desktop.

@isidorn isidorn added extensions Issues concerning extensions under-discussion Issue is under discussion for relevance, priority, approach labels Nov 1, 2021
@isidorn
Copy link
Contributor

isidorn commented Nov 1, 2021

We do not recommend extensions to have different package.json content per platform.
I do see your use case though and an alternative approach would be to introduce when context for extension dependencies.

@sandy081 @aeschli what do you think? Do you have other ideas?

@sandy081
Copy link
Member

sandy081 commented Nov 3, 2021

Not sure when context might work as the extensions are controlled in different process (shared, renderer, extension host) and we do not have same contexts every where. Other option would be to add platform semantics to dependencies. For eg.,

"extensionDependencies": [
    {
      "id": "ms-python.vscode-pylance",
      "platforms": ["-web"]
    },
    "dbaeumer.vscode-eslint"
  ]

We contemplated creating a custom package.json for the web platform, but Settings Sync in this situation would lead to an issue for users who chose to uninstall Pylance on desktop.

I agree that it is not recommended to have different package.jsons per platform. But I do not understand how settings sync will uninstall Pylance on desktop? Settings Sync does not respect extension pack or dependencies. It just sync extension by extension.

Can you please explain more why python extension does not want pylance to be part of python in web? What are the consequences of having it?

CC: @alexdima

@brettcannon
Copy link
Member Author

But I do not understand how settings sync will uninstall Pylance on desktop?

It's not uninstall, it's re-installing Pylance when a user may have uninstalled it on desktop perviously. So the scenarios I'm concerned about is:

  1. User installs the Python extension on desktop, which brings in Pylance.
  2. They uninstall Pylance on desktop.
  3. They install the Python extension on web which brings in Pylance as a required dependency (if we make this change).
  4. Settings Sync sees Pylance installed on web, and so reinstalls it on desktop.

@sandy081
Copy link
Member

sandy081 commented Nov 5, 2021

Ah I see. So Python has hard dependency on Pylance in web.

In that case, Settings Sync will always brings in Pylance on desktop irrespective of how you define dependencies.

@alefragnani
Copy link

Hi,

Any news about this? I'm facing a similar issue once my Pascal extension depends on my Pascal Formatter extension (defined using extensionDependencies entry in package.json).

I'm trying to adapt my Pascal extension to work on the web, and because the Formatter wouldn't be available on the web, it makes no sense to install/updated it either.

Thank you

@isidorn
Copy link
Contributor

isidorn commented Mar 7, 2022

@alefragnani so far no news here. Sorry.

@isidorn isidorn added this to the Backlog milestone Mar 7, 2022
@alefragnani
Copy link

@isidorn thanks for the update. No Pascal on the web, for now 😄

@lambdageek
Copy link
Member

Now that ms-vscode.wasm-wasi-core exists (https://code.visualstudio.com/blogs/2023/06/05/vscode-wasm-wasi), it would be quite nice if I, as an extension author, could say "On the web, I depend on WASI; on the desktop I depend on [some extension providing a native runtime]" in my package.json file.

@isidorn isidorn added the *out-of-scope Posted issue is not in scope of VS Code label Dec 14, 2023
@vscodenpa
Copy link

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions Issues concerning extensions *out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

7 participants