<commit_before>const { AutoLanguageClient } = require("atom-languageclient");
const { install } = require("atom-package-deps");
const path = require('path');
const cp = require("child_process");

class CQLLanguageClient extends AutoLanguageClient {
  getGrammarScopes() {
    //console.log('CQLLanguageClient.getGrammarScopes');
    return [ "source.cql" ];
  }
  getLanguageName() {
    //console.log('CQLLanguageClient.getLanguageName');
    return "cql";
  }
  getServerName() {
    //console.log('CQLLanguageClient.getServerName');
    return "cql-language-server";
  }

  startServerProcess() {
    //console.log('CQLLanguageClient.startServerProcess');
    const options = { 'cwd': __dirname };
    const command = "java";
    const jarpath = path.join(__dirname, '..', 'language-server', 'fat-jar.jar');

    var args = [
        '-cp',
        jarpath,
        '-Xverify:none', // helps VisualVM avoid 'error 62',
        'org.cqframework.cql.Main'
    ];

    const child = cp.spawn(command, args, options);
    this.captureServerErrors(child);
    return child;
  }
}

module.exports = new CQLLanguageClient();<commit_msg>Added debug switch/args to child_process spawn of jar<commit_after>const { AutoLanguageClient } = require("atom-languageclient");
const { install } = require("atom-package-deps");
const path = require('path');
const cp = require("child_process");

class CQLLanguageClient extends AutoLanguageClient {

  getGrammarScopes() {
    //console.log('CQLLanguageClient.getGrammarScopes');
    return [ "source.cql" ];
  }
  getLanguageName() {
    //console.log('CQLLanguageClient.getLanguageName');
    return "cql";
  }
  getServerName() {
    //console.log('CQLLanguageClient.getServerName');
    return "cql-language-server";
  }

  startServerProcess() {
    //console.log('CQLLanguageClient.startServerProcess');
    const options = { 'cwd': __dirname };
    const command = "java";
    const jarpath = path.join(__dirname, '..', 'language-server', 'fat-jar.jar');

    var args = [
        '-cp',
        jarpath,
        '-Xverify:none', // helps VisualVM avoid 'error 62',
        '-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5051,quiet=y',
        'org.cqframework.cql.Main'
    ];

    const child = cp.spawn(command, args, options);
    this.captureServerErrors(child);
    return child;
  }

  // shouldStartForEditor() {
  //   return true;
  // }
}

module.exports = new CQLLanguageClient();
{'fraction_non_alphanumeric': 0.15212071778140293, 'fraction_numerical': 0.0032626427406199023, 'mean_word_length': 3.5679702048417132, 'pattern_counts': {'":': 0, '<': 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': '1939723', 'n_tokens_mistral': 791, 'n_tokens_neox': 776, 'n_words': 139}