Open kineticsquid opened 5 months ago
It's likely that the extension is just using an unbundled require('node-pty')
call and expects that vscode just makes the library available in the extension host. There is a bit of discussion surrounding this practice and it's discouraged by the maintainer of node-pty (who is a major vscode contributor), see https://github.com/microsoft/node-pty/issues/582.
Anyway, an obvious fix to this would be to expose the node-pty
library in our plugin host. As far as I know, vscode is doing this by bundling their app in a smart way, while we just bundle everything, which makes plain node.js require
calls fail.
@msujew Thanks for the explanation. To make sure I understand, this is a change you would make to expose the library?
@kineticsquid We could do that, yes. It's not ideal, since it's discouraged, but it's not like VSCode actually punishes extension developers that just side-load vscode's owns dependencies.
@tsmaeder Your opinion on this? VS Code exposes its own native dependencies to its extensions. Doing the same would require us to keep our versions of these dependencies up to date with VS Code.
@kineticsquid do you mean this one? https://marketplace.visualstudio.com/items?itemName=GoogleCloudTools.cloudcode
@msujew @kineticsquid I cannot express in polite conversation just what I think of the practice of depending on the implementation details of your host platform if said platform goes out of its way to provide a well-defined API for interacting with that platform.
As for aligning our dependencies with VS Code: that way lies madness! The Theia platform is implemented differently from VS Code and therefore necessarily has different dependencies and dependency versions. If we start doing this, we would also make the integration work of our adopters infinitely more difficult. So as far as I am concerned, it's a hard no!
My suggestion would be to go complain to the Google team and complain loudly! If folks go out of their way to be incompatible with Theia, I don't think making those cases work is a reasonable use of our limited resources.
What we do for the built-in's is to package some dependencies in our build script: https://github.com/eclipse-theia/vscode-builtin-extensions/blob/master/src/package-vsix.js#L71. One way to go would be to rebundle the extension in a custom build script for open-vsx to include the proper version of node-pty during the extension build.
@tsmaeder Yes, that's the extension I was referring to. And I certainly defer to your judgement in how we approach this inconsistency. If we start with the fact that the implementations of the platforms are different and so will cause inconsistencies in extension behavior, what's the best approach? Do we ask extension developers to make changes or do we go the custom build script approach? Seems the latter could get fragile.
Bug Description:
I use the Google Cloud extension on VS. I tried it on the latest Theia release and it fails on loading:
I confirmed the latest release of the extension on my VS installation and then tried various combinations of un-installing, re-instalilng and restarting Theia, but no luck.
Additional Information