Can i block some files which i don't want the user open?

I found that it is very slow for my Theia to open big files, sometimes it even disconnects while i double click a big file in the Explorer. So can i block some files which i don’t want the user open?

@PeimingMo1 just as a heads up, handling of large files has been fixed: https://github.com/eclipse-theia/theia/pull/8152 and will be present in the upcoming release or when currently using next.

For you general question of preventing the opening of certain files you will need to do something similar to the following comment: Prevent code editing for specific file extension. In general, in a custom extension you will need to rebind EditorManager to update the canHandle based on your logic (0 denotes files cannot be opened). This method controls for a given resource if it can be opened by a code editor (and is always true in it’s default implementation).

For a test, i change the return of canHandle to return 0, but it doesn’t work, i still can open files, and some error accur at the same time.

@PeimingMo1 sorry, the use-case I linked is only a partial solution of removing the code-editor opener as part of the open with... context-menu. If one wants to modify the behavior of when file resources should be opened there are parts that need to be addressed such as the open command, and modifying the explorer view (when selecting tree-nodes). There are many components to update/maintain that I believe it’d be best to pick up the feature which is already implemented in the newest version.

Ok i see, thank you.

BTW, when does the new version release?
image

@PeimingMo1 the framework has monthly releases, generally on the last Thursday of the month.
As mentioned, it is also possible to use a next version to pick up the changes already.