-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Reuse VS Code's extension host #6353
Comments
So the 30k lines is what is in the respect VS Code folder. In Theia we currently have 14k LOC. |
Another reason to go down this path, is that VS Code extension might 'hack' their way into non API things. E.g. gitlens does this: |
Not a fan, for various reasons:
CC @eclipse-theia/plugin-system because this needs discussion. |
let say you could reduce even more Theia's code if you grab https://github.com/cdr/code-server directly more seriously:
well Eclipse Che needs to provide others API namespace for VS Code extensions. (it's ok to not touch 'vscode' namespace) and we support plug-ins on the frontend side as well. |
I totally understand that this proposal seem a bit scary. But as the positive effects look so compelling I think it is worth discussing a bit more.
Would it be possible to implement those plugins as Theia extensions instead or do users actively install and uninstall them at runtime?
Starting multiple such processes in different containers should still be possible, I think.
I understand this argument in theory, but looking at the past changes on the RPC protocol it doesn't seem to be much different or even a little easier. Mainly because we will not have to catch up with everything that runs within the host process. The underlying point here is that in order to eventually run all vs code extensions there should be no differences in the runtime platform (the host process). Manually rewriting the exact same thing doesn't make much sense and will keep us busy and in distance from the goal to fully support them and staying up to date with changes. I understand the custom namespaces feature is the only 'difference' to the original host process. The price we pay for this rarely used feature is extremely high. |
We should at least reuse https://github.com/microsoft/vscode/blob/2305f2187475d860f5f70c8d3bff548f6ce08929/src/vs/workbench/api/common/extHostTypes.ts#L334 and make sure that it is easy to catch up with them. Right now it is not possible to compare it with https://github.com/eclipse-theia/theia/blob/master/packages/plugin-ext/src/plugin/types-impl.ts. I've just found another bug Range.toJSON is missing and webview rely on this: #6578 (comment). Implementation of VS Code types should be exactly the same. Looking at how much APIs we already covered, maybe it is not bad idea to reverse dependencies between theia plugins and VS Code extensions, i.e.
It sounds like a big refactoring, but we possibly can get rid of many small bugs and focus on IDE part more. |
We should and could reuse the entire code that runs the extension host process.
I'm talking about everything in this folder: https://github.com/microsoft/vscode/tree/master/src/vs/workbench/api
Atm we are reimplementing the whole thing but I don't really understand why. Instead we should only implement the IPC protocol and run the extension host as is.
Doing this would
The only downside I see is that we are no longer able to extend the API, which I'd personally be happy to trade for those benefits.
The text was updated successfully, but these errors were encountered: