import { ContainerModule } from "inversify"; import { ConnectionHandler, JsonRpcConnectionHandler } from '@theia/core/lib/common'; import { CatalogoServerImpl } from "./catalogo-backend-impl"; import { extensionPath, CatalogoServer } from "../common/catalogo-protocol"; export default new ContainerModule(bind => { bind(CatalogoServerImpl).toSelf().inSingletonScope(); bind(CatalogoServer).toDynamicValue(ctx => ctx.container.get(CatalogoServerImpl)).inSingletonScope(); bind(ConnectionHandler).toDynamicValue(ctx => { return new JsonRpcConnectionHandler(extensionPath, () => ctx.container.get(CatalogoServer)); }).inSingletonScope(); });