-
Notifications
You must be signed in to change notification settings - Fork 70
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
[QUESTION] How to use File System Access API with IDE? #65
Comments
@CaptainNeo2023 you can use import { IFileServiceClient } from '@opensumi/ide-file-service';
...
@Autowired(IFileServiceClient)
protected readonly fileServiceClient: IFileServiceClient;
... |
The browser source code uses file-system-access function call showDirectoryPicker to let user to select folder in the local file system to be opened in IDE window. Below sample code illustrates where the workspace should be opened in the window but we would like to know how to use IFileServiceClient to fetch folders and files from the file system where user has selected folder to be opened on IDE by the browser whereas node.js server run on remote computer, and instead of using this.window.showOpenDialog function call the command uses showDirectoryPicker function from File System Access API to be able to use browser in different computer than node.js server is located.
The question is still how to show folders and files in IDE window if using IFileServiceClient to create workspace folders and files from the local file system? |
@CaptainNeo2023 If you want to create a file picker, you can use |
But the server isn't same computer, only browser is in this computer where to create workspace, only File System Access API may access to the local file system where browser is run, the IDE run on remote computer where browser URL is located, but we don't want to use file system on remote computer, only access file system on same computer where browser requests client code, therefore we can't use this part of code anylonger, only showDirectoryPicker function is allowed to access the local file system
|
@CaptainNeo2023 Maybe you are finding a resolution like |
The showOpenDialog lets user to select folder from the Node.js file system. The showDirectoryPicker() method shows a directory picker that lets the user select a single directory, returning File System Access handle for the selected directory. The question is still how to create workspace folders and files from the local file system located on user browser? |
@CaptainNeo2023 maybe you should do it by yourself, there is no default implementation within the framework and I have no further suggestions. |
We would like to access local file system but node.js server is deployed into remote computer like web cloud service whereas the client browser runs in our local computer PC, so question is how to extend IDE to be able to access local file system for example using File System Access API, and if OpenSumi may provide that feature in case that server and client not on same computer to access local file system for IDE?
The text was updated successfully, but these errors were encountered: