-
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
How to rebind FileSystemNode #6740
Comments
You are on the right path, just use the following as your backend binding in the module: import { ContainerModule, interfaces } from 'inversify';
import { ConnectionHandler, JsonRpcConnectionHandler } from '@theia/core/lib/common';
import { FileSystem, DispatchingFileSystemClient, FileSystemClient } from '@theia/filesystem/lib/common';
import { SecurityFileSystemNode } from './node-filesystem';
export default new ContainerModule((bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind) => {
bind(SecurityFileSystemNode).toSelf().inSingletonScope();
rebind(FileSystem).toService(SecurityFileSystemNode);
}); I have just tried it and it works. If you still have issues, let us know. Otherwise, please close the issue. Thank you! |
Wont work for me! |
Yes, I could. Please share your backend module with the binding customization and your custom FS class. If you could push your code to a public repo, that would help. |
I push my code to a public repo https://github.com/datou0412/theia-test Follow the README to reproduce |
@kittaakos in your code snippet shouldn't FileSystem be FileSystemNode? like:
I wonder if that might be the issue |
wont work -- |
I could reproduce. Thanks! Please compile against My changes: diff --git a/browser-app/package.json b/browser-app/package.json
index cc221ef..c73f34b 100644
--- a/browser-app/package.json
+++ b/browser-app/package.json
@@ -2,7 +2,8 @@
"name": "theia-test",
"version": "0.0.1",
"scripts": {
- "prepare": "yarn theia build"
+ "prepare": "yarn theia build",
+ "start": "yarn theia start"
},
"dependencies": {
"typescript": "latest",
diff --git a/packages/security/tsconfig.json b/packages/security/tsconfig.json
index 6cab26f..fe0e937 100644
--- a/packages/security/tsconfig.json
+++ b/packages/security/tsconfig.json
@@ -16,7 +16,7 @@
"resolveJsonModule": true,
"module": "commonjs",
"moduleResolution": "node",
- "target": "es6",
+ "target": "es5",
"jsx": "react",
"lib": ["es6", "dom"],
"sourceMap": true I also had to wipe the
For more details on why we have to use
Closing as answered. |
Follow-up: #6761 |
Description
I want to customize
resolveContent
method, i tried this way but failednode-filesystem.ts
security-backend-module.ts
The text was updated successfully, but these errors were encountered: