-
Notifications
You must be signed in to change notification settings - Fork 17
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
Access to electron API and VSCode methods. #2
Comments
I actually managed to get a PoC working, but only using monkey-patch directly. It didn't seem to load my extensions, but will load my files using the config. utils.override(app.CodeApplication, "openFirstWindow", function (appOriginal) {
utils.override(win.CodeWindow, "onConfigurationUpdated", function (windowOriginal) {
let window = this;
window._win.removeAllListeners('swipe');
window._win.addListener("swipe", function (_event, cmd) {
if (cmd == "left") {
window.sendWhenReady('vscode:runAction', { id: 'workbench.action.navigateBack' });
}
else if (cmd == "right") {
window.sendWhenReady('vscode:runAction', { id: 'workbench.action.navigateForward' });
}
});
return windowOriginal();
});
return appOriginal();
}); |
Well, you can look at https://github.com/iocave/customize-ui to see extension built on top of monkey-patch. It is bit more involved, as the extension needs to copy the injected javascript files in global storage. That is because extension path changes with each extension update, however the module folders registered with monkey-patch must remain the same. |
Right, I think the issue stemmed from using two extensions that dependent on monkey patch. Most certain I am doing something wrong here, or it's related to how loading dev-extensions work in Vscode. Anyhow, I've managed to at least load my own files using Gotta figure out a nice way of loading config from the user and do proper logging. |
Well, I haven't really tried monkey-patch with multiple extensions, but in theory there shouldn't be difference between multiple extension and single extension with multiple contributed modules. |
Sorry to use your issue tracker for questions, but I'm trying to implement swipe to navigate and I was wondering if monkey patching would give me access to the Electron
BrowserWindow
and the ability to accessIWorkbenchEditorConfiguration
and other VSCode code that isn't listed aspub
(TypeScript accessors).I kinda rely heavily on microsoft/vscode#82528 and unfortunately it got yanked -
I am not exactly sure why, but I am guessing it stemmed from confusion on what it was supposed to do and the team doesn't want to rely on further Electron API usage.The text was updated successfully, but these errors were encountered: