modula2-compiler-backend-module.ts 720 B

1234567891011121314
  1. import { ContainerModule } from '@theia/core/shared/inversify';
  2. import { ConnectionHandler } from '@theia/core/lib/common/messaging/handler';
  3. import { RpcConnectionHandler } from '@theia/core/lib/common/messaging/proxy-factory';
  4. import { Modula2Compiler, Modula2CompilerServicePath } from '../common/compiler';
  5. import { GnuModula2CompilerService } from './compiler-service';
  6. export default new ContainerModule(bind => {
  7. bind(Modula2Compiler).to(GnuModula2CompilerService).inSingletonScope();
  8. bind(ConnectionHandler).toDynamicValue(ctx =>
  9. new RpcConnectionHandler<Modula2Compiler>(
  10. Modula2CompilerServicePath,
  11. () => ctx.container.get<Modula2Compiler>(Modula2Compiler),
  12. )).inSingletonScope();
  13. });