How to use the monaco-languageclient/lib/connection.createConnection function in monaco-languageclient

To help you get started, we’ve selected a few monaco-languageclient 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 ballerina-platform / ballerina-lang / composer / lang-service / src / server.ts View on Github external
function createLSConnection(ballerinaHome: string) : LangServerProcessConnection {
    const childProcess = createServer(ballerinaHome);
    childProcess.on('error', (err) => {
        // log('Error while starting LS', err);
    });
    const reader = new StreamMessageReader(childProcess.stdout);
    const writer = new StreamMessageWriter(childProcess.stdin);
    const messageConntection = createMessageConnection(reader, writer);
    const errorHandler: ConnectionErrorHandler = (err, msg, count) => {
       // log('Error while starting LS', err);
    };
    const closeHandler: ConnectionCloseHandler = () => {
       // log('LS Connection closed');
    };
    const lsConnection = createConnection(messageConntection, errorHandler, closeHandler);
    return {
        childProcess,
        lsConnection
    }
}