<commit_before>import * as path from "path";
import { workspace } from "vscode";
import { ServerOptions, LanguageClientOptions, LanguageClient, TransportKind } from "vscode-languageclient";
import * as fileCommon from "./common";
import { Request, RequestResult, RequestEventType, RequestParams, RequestPackage } from "./fileServiceInterface";
import Event from "../common/event";
import { Settings } from "../common/settings";
import * as utils from "../common/utils";
import * as gitCommon from "../git/common";
import { Gerrit } from "../gerrit/gerrit";

export class GlobalFileContainerClient {
    private languageClient: LanguageClient;
    private static _client: GlobalFileContainerClient = null;

    constructor() {
    }

    static getInstance() {
        if (utils.isNull(GlobalFileContainerClient._client)) {
            GlobalFileContainerClient._client = new GlobalFileContainerClient();
        }
        return GlobalFileContainerClient._client;
    }

    private getOptions(): { serverOptions: ServerOptions, clientOptions: LanguageClientOptions } {
        let serverModule = path.join(Settings.getInstance().extensionRoot, "out", "src",
            "files", "server", "fileServiceServer.js");
        let debugOptions = {
            execArgv: ["--nolazy", "--debug=6004"],
            // cwd: GerritSettings.getInstance().extensionRoot
        };

        // If the extension is launch in debug mode the debug server options are use
        // Otherwise the run options are used
        let serverOptions: ServerOptions = {
            run: {
                module: serverModule, transport: TransportKind.ipc, options: {
                    cwd: Settings.getInstance().extensionRoot
                }
            },
            debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
        };

        let clientOptions: LanguageClientOptions = {
            // Register the server for plain text documents
            documentSelector: ["plaintext"],
            synchronize: {
                // Synchronize the setting section "languageServerExample" to the server
                configurationSection: "languageServerExample",
                // Notify the server about file changes to ".clientrc files contain in the workspace
                fileEvents: workspace.createFileSystemWatcher("**/.clientrc")
            },
            initializationOptions: {
                debug: true
            }
        };

        return { "serverOptions": serverOptions, "clientOptions": clientOptions };<commit_msg>Clean up server launch options<commit_after>import * as path from "path";
import { workspace } from "vscode";
import { ServerOptions, LanguageClientOptions, LanguageClient, TransportKind } from "vscode-languageclient";
import * as fileCommon from "./common";
import { Request, RequestResult, RequestEventType, RequestParams, RequestPackage } from "./fileServiceInterface";
import Event from "../common/event";
import { Settings } from "../common/settings";
import * as utils from "../common/utils";
import * as gitCommon from "../git/common";
import { Gerrit } from "../gerrit/gerrit";

export class GlobalFileContainerClient {
    private languageClient: LanguageClient;
    private static _client: GlobalFileContainerClient = null;

    constructor() {
    }

    static getInstance() {
        if (utils.isNull(GlobalFileContainerClient._client)) {
            GlobalFileContainerClient._client = new GlobalFileContainerClient();
        }
        return GlobalFileContainerClient._client;
    }

    private getOptions(): { serverOptions: ServerOptions, clientOptions: LanguageClientOptions } {
        let serverModule = path.join(Settings.getInstance().extensionRoot, "out", "src",
            "files", "server", "fileServiceServer.js");
        let debugOptions = {
            execArgv: ["--nolazy", "--debug=6004"],
            cwd: Settings.getInstance().extensionRoot
        };

        // If the extension is launch in debug mode the debug server options are use
        // Otherwise the run options are used
        let serverOptions: ServerOptions = {
            run: {
                module: serverModule, transport: TransportKind.ipc, options: {
                    cwd: Settings.getInstance().extensionRoot
                }
            },
            debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
        };

        let clientOptions: LanguageClientOptions = {
            synchronize: {
                configurationSection: "gerrit"
            },
            initializationOptions: {
                debug: true
            }
        };

        return { "serverOptions": serverOptions, "clientOptions": clientOptions };
{'fraction_non_alphanumeric': 0.1012844809433565, 'fraction_numerical': 0.0016845651716150768, 'mean_word_length': 2.60668185269552, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7462588', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1089, 'n_words': 326}