How to use @theia/process - 3 common examples

To help you get started, we’ve selected a few @theia/process examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse-theia / theia / packages / cpp / src / node / cpp-contribution.ts View on Github external
async start(clientConnection: IConnection, { parameters }: CppStartOptions): Promise {

        const command =
            process.env.CPP_CLANGD_COMMAND
            || (parameters && parameters.clangdExecutable)
            || CLANGD_EXECUTABLE_DEFAULT;

        const args = parseArgs(
            process.env.CPP_CLANGD_ARGS
            || (parameters && parameters.clangdArgs)
            || undefined
        );

        const clangTidy = parameters && parameters.clangTidy;
        const clangTidyChecks = parameters && parameters.clangTidyChecks;

        if (clangTidy) {
            const supportsClangTidy = await this.testSupportsClangTidy(command);
            if (supportsClangTidy) {
                args.push('-clang-tidy');
                if (typeof clangTidyChecks === 'string' && clangTidyChecks.length > 0) {
                    args.push(`-clang-tidy-checks=${clangTidyChecks}`);
                }
            }
github spring-projects / sts4 / theia-extensions / theia-commons / src / node / language-server-contribution.ts View on Github external
async start(clientConnection: IConnection, { parameters }: JavaLsStartOptions) {

        const userJavaHome =
            (parameters && parameters.javahome)
            || process.env.STS_LSP_JAVA_HOME;

        const args = parseArgs(
            (parameters && parameters.vmargs)
            || process.env.STS_LSP_JAVA_VMARGS
            || undefined
        );

        const jvm = await this.findJvm(userJavaHome);

        this.validate(jvm);

        const server = await this.startSocketServer();
        const socket = this.accept(server);
        const env = Object.create(process.env);
        const addressInfo = server.address();
        if (typeof addressInfo === 'string') {
            throw new Error(`Address info was string ${addressInfo}`);
        }
github eclipse-theia / theia / packages / python / src / node / python-contribution.ts View on Github external
async start(clientConnection: IConnection): Promise {
        let command = 'python';
        let args = ['-m', 'pyls'];
        const pythonLsCommand = process.env.PYTHON_LS_COMMAND;
        if (pythonLsCommand) {
            command = pythonLsCommand;
            args = parseArgs(process.env.PYTHON_LS_ARGS || '');
        }
        const serverConnection = await this.createProcessStreamConnectionAsync(command, args, this.getSpawnOptions());
        this.forward(clientConnection, serverConnection);
    }

@theia/process

Theia process support.

EPL-2.0
Latest version published 18 days ago

Package Health Score

87 / 100
Full package analysis

Popular @theia/process functions