import { ContainerModule } from '@theia/core/shared/inversify'; import { ConnectionHandler } from '@theia/core/lib/common/messaging/handler'; import { RpcConnectionHandler } from '@theia/core/lib/common/messaging/proxy-factory'; import { Modula2Compiler, Modula2CompilerServicePath } from '../common/compiler'; import { GnuModula2CompilerService } from './compiler-service'; export default new ContainerModule(bind => { bind(Modula2Compiler).to(GnuModula2CompilerService).inSingletonScope(); bind(ConnectionHandler).toDynamicValue(ctx => new RpcConnectionHandler( Modula2CompilerServicePath, () => ctx.container.get(Modula2Compiler), )).inSingletonScope(); });