Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
super(null); // TODO(gabriel): add support to lean-client-js
this.statusChanged = new LowPassFilter(300);
this.restarted = new Event();
this.messages = [];
this.attachEventHandlers();
}
});
}
msgs = msgs.map((msg) => ({
...msg,
text: msg.text.length <= MAX_MESSAGE_SIZE ? msg.text :
msg.text.slice(0, MAX_MESSAGE_SIZE) +
`\n(message too long, truncated at ${MAX_MESSAGE_SIZE} characters)`,
}));
return msgs;
}
// A global channel for storing the contents of stderr.
let stderrOutput: OutputChannel;
// A class for interacting with the Lean server protocol.
export class Server extends leanclient.Server {
transport: ProcessTransport;
executablePath: string;
hasLean: boolean = false; // have we found a usable copy of Lean yet?
workingDirectory: string;
options: string[];
statusChanged: LowPassFilter;
restarted: Event;
messages: Message[];
constructor() {
super(null); // TODO(gabriel): add support to lean-client-js
this.statusChanged = new LowPassFilter(300);
this.restarted = new Event();
this.messages = [];
this.hasLean = false;
}
} else {
this.hasLean = true;
}
}
this.workingDirectory = workspace.rootPath;
this.options = config.get('extraOptions') || [];
this.options.push('-M');
this.options.push('' + config.get('memoryLimit'));
this.options.push('-T');
this.options.push('' + config.get('timeLimit'));
this.transport = new ProcessTransport(
this.executablePath, this.workingDirectory, this.options);
super.connect();
this.restarted.fire(null);
} catch (e) {
this.requestRestart(e.message);
}
}