Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}`);
}
}
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}`);
}
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);
}