in src/main.ts [134:170]
function generateServerOptions(executablePath: string): ServerOptions {
let serverArgs = [];
let serverCommand: string = executablePath;
let config = vscode.workspace.getConfiguration("pgsql");
if (config) {
// Override the server path with the local debug path if enabled
let useLocalSource = config["useDebugSource"];
if (useLocalSource) {
let localSourcePath = config["debugSourcePath"];
let filePath = path.join(localSourcePath, "pgsqltoolsservice/pgtoolsservice_main.py");
process.env.PYTHONPATH = localSourcePath;
serverCommand = process.platform === 'win32' ? 'python' : 'python3';
let enableStartupDebugging = config["enableStartupDebugging"];
let debuggingArg = enableStartupDebugging ? '--enable-remote-debugging-wait' : '--enable-remote-debugging';
let debugPort = config["debugServerPort"];
debuggingArg += '=' + debugPort;
serverArgs = [filePath, debuggingArg];
}
let logFileLocation = path.join(Utils.getDefaultLogLocation(), "pgsql");
serverArgs.push('--log-dir=' + logFileLocation);
serverArgs.push(logFileLocation);
// Enable diagnostic logging in the service if it is configured
let logDebugInfo = config["logDebugInfo"];
if (logDebugInfo) {
serverArgs.push('--enable-logging');
}
}
// run the service host
return { command: serverCommand, args: serverArgs, transport: TransportKind.stdio };
}