<commit_before>const cp = require('child_process');
const fs = require('fs');
const path = require('path');
const url = require('url');
const remote = require('remote-file-size');
const PortFinder = require('portfinder');
const net = require('net');
const rpc = require('vscode-jsonrpc');
const {AutoLanguageClient, DownloadFile} = require('atom-languageclient');

export class JarLanguageClient extends AutoLanguageClient {

    constructor(serverDownloadUrl, serverHome) {
        super();

        this.serverHome = serverHome;
        this.serverDownloadUrl = serverDownloadUrl;
        this.serverLauncherJar = path.basename(url.parse(this.serverDownloadUrl).pathname);
    }

    startServerProcess () {
        // //TODO: Remove when debugging is over
        atom.config.set('core.debugLSP', true);

        let childProcess;

        return new Promise((resolve, reject) => {
            PortFinder.getPort((err, port) => {
                let server = net.createServer(socket => {
                    server.close();
                    this.socket = socket;
                    resolve(childProcess);
                });

                server.listen(port, 'localhost', () => {
                    this.launchProcess(port).then(p => childProcess = p);
                });

            });<commit_msg>Switch to a specific commit of atom-languageclient<commit_after>const cp = require('child_process');
const fs = require('fs');
const path = require('path');
const url = require('url');
const remote = require('remote-file-size');
const PortFinder = require('portfinder');
const net = require('net');
const rpc = require('vscode-jsonrpc');
const {AutoLanguageClient, DownloadFile} = require('atom-languageclient');

export class JarLanguageClient extends AutoLanguageClient {

    constructor(serverDownloadUrl, serverHome, serverLauncherJar) {
        super();

        this.serverHome = serverHome;
        this.serverDownloadUrl = serverDownloadUrl;
        this.serverLauncherJar = serverLauncherJar;
    }

    startServerProcess () {
        // //TODO: Remove when debugging is over
        atom.config.set('core.debugLSP', true);

        let childProcess;

        return new Promise((resolve, reject) => {
            PortFinder.getPort((err, port) => {
                let server = net.createServer(socket => {
                    server.close();
                    this.socket = socket;
                    resolve(childProcess);
                });

                server.listen(port, 'localhost', () => {
                    this.launchProcess(port).then(p => childProcess = p);
                });

            });
{'fraction_non_alphanumeric': 0.12575757575757576, 'fraction_numerical': 0.0, 'mean_word_length': 2.4432855280312906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2365118', 'n_tokens_mistral': 690, 'n_tokens_neox': 659, 'n_words': 149}