How to use lean-client-js-node - 3 common examples

To help you get started, we’ve selected a few lean-client-js-node 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 leanprover / vscode-lean / src / server.ts View on Github external
constructor() {
        super(null); // TODO(gabriel): add support to lean-client-js
        this.statusChanged = new LowPassFilter<ServerStatus>(300);
        this.restarted = new Event();
        this.messages = [];

        this.attachEventHandlers();
    }
github leanprover / vscode-lean / src / server.ts View on Github external
});
    }
    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<ServerStatus>;
    restarted: Event<any>;

    messages: Message[];

    constructor() {
        super(null); // TODO(gabriel): add support to lean-client-js
        this.statusChanged = new LowPassFilter<ServerStatus>(300);
        this.restarted = new Event();
        this.messages = [];
github leanprover / vscode-lean / src / server.ts View on Github external
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);
        }
    }

lean-client-js-node

Interface to the Lean server

Apache-2.0
Latest version published 6 months ago

Package Health Score

62 / 100
Full package analysis

Similar packages

Popular JavaScript code snippets

Find secure code to use in your application or website