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

Cannot create projects with swift extension #14714

Open
suvnoque opened this issue Jan 11, 2025 · 8 comments · May be fixed by #14720
Open

Cannot create projects with swift extension #14714

suvnoque opened this issue Jan 11, 2025 · 8 comments · May be fixed by #14720

Comments

@suvnoque
Copy link

Bug Description:

Cannot create new project with the swift extension

Steps to Reproduce:

  1. Install Swift extension
  2. Run command "Swift: Create New Project..."
  3. Error message appears

Additional Information

image

  • Operating System: Windows 10 Home
  • Theia Version: 1.57.100
@JonasHelming
Copy link
Contributor

@tsmaeder

@tsmaeder
Copy link
Contributor

That looks like the extension is trying to load something from VS Code's node-modules folder. We don't have such a folder since we are webpack-bundling our back end. It looks like the code in question is https://github.com/swiftlang/vscode-swift/blob/main/src/utilities/native.ts There's also microsoft/node-pty#582 and the discussion in microsoft/vscode#658. T.b.h, I don't really know what we could do except trying to reproduce the exact environment VS Code provides, but even the MS devs warn that this environment is not stable.

@tsmaeder
Copy link
Contributor

I think @msujew knows a bit about platform-specific extensions. Maybe he has an idea?

@sdirix
Copy link
Member

sdirix commented Jan 13, 2025

We have a similar issue for another extension: #14638

i.e. some extensions expect some binaries in specific places in the delivery

@msujew
Copy link
Member

msujew commented Jan 13, 2025

Note that we had the same discussion @tsmaeder in #13779. We definitely could reproduce the VS Code environment (sans the exact version of node-pty). It shouldn't be too much work, but it's rather a question of whether we want to support that.

@tsmaeder
Copy link
Contributor

I am just wary of setting up another regular task where we have to track the node_modules folder in VS code. Maybe we just should set up some "common library" of node modules that we make available in the plugin host. The trouble is then if folks rely on behavior of a particular version (e.g. node-pty has many preview versions). The same will happen to extensions as VS code updates their versions of packaged node modules, though.

@sdirix
Copy link
Member

sdirix commented Jan 13, 2025

I think a low effort approach to place some of our dependencies/binaries in the same location as VS Code does, makes sense. Just to be a bit more compatible in a pragmatic fashion.

I completely agree with @tsmaeder that we should not try to replicate VS Code's environment 100% as this will require a lot of work and is not encouraged anyway.

@msujew msujew linked a pull request Jan 13, 2025 that will close this issue
1 task
@msujew
Copy link
Member

msujew commented Jan 13, 2025

@sdirix With the current webpack/bundling setup, it's rather complicated to exclude specific dependencies to remain inside the node_modules. And how even is an adopter supposed to figure out which node_modules folders are required and which are not when packaging their app for production?

I've provided a PR #14720 to fix any extension that specifically requires the node-pty package. This method can be extended to support all of VSCode's bundled packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants