How to theia open workspace from workspace format

By default, the theia open workspace dialog provide “.theia-workspace" and ".code-workspace” file format.

I want to add my custom workspace file format like “*.custom-workspace”, but i can’t find any code about that.
Can someone give me some guidance?
Thanks a lot.

Hey @4EverM,

you can customize your workspace file extension in the WorkspaceFileService.

I have cheked the code of WorkspaceFileService and extend the WorkspaceFileService and export CustomWorkspaceFileService .
Here are some of my attempts.

/// hello-world/src/common/custom-workspace-file-service.ts
import {injectable} from "@theia/core/shared/inversify";
import {THEIA_EXT, VSCODE_EXT, WorkspaceFileService, WorkspaceFileType} from "@theia/workspace/lib/common/workspace-file-service"



export const CUSTOM_EXT = "custom-workspace";

@injectable()
export class CustomWorkspaceFileService extends WorkspaceFileService {

    getWorkspaceFileTypes(): WorkspaceFileType[] {
        return [
            {
                name: 'Theia',
                extension: THEIA_EXT
            },
            {
                name: 'Visual Studio Code',
                extension: VSCODE_EXT
            },
            {
                name: 'Custom',
                extension: CUSTOM_EXT
            }
        ];
    }
}

But, i don’t know what the next step is ? Can you type some sample code? :pray: :pray: :pray:

All you need to do now is to rebind the service in your frontend application module:

rebind(WorkspaceFileService).to(CustomWorkspaceFileService).inSingletonScope();

Thank you so much!