From ca30ac4b27d9150096e4b275df500bfde8f68103 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sun, 11 Jul 2021 00:01:45 +0100 Subject: [PATCH] Set lower-than-default priority for languageserver --- lib/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/main.js b/lib/main.js index b0e511d..35fa1cc 100644 --- a/lib/main.js +++ b/lib/main.js @@ -1,6 +1,7 @@ const cp = require('child_process') const fs = require('fs') const net = require('net') +const os = require('os'); const path = require('path') const {shell} = require('electron') const {AutoLanguageClient, DownloadFile} = require('atom-languageclient') @@ -22,7 +23,7 @@ class PHPLanguageClient extends AutoLanguageClient { provide.suggestionPriority = atom.config.get('ide-php.autocompletePriority') === 'lower' ? 1 : 2 return provide } - + onDidConvertAutocomplete(completionItem, suggestion, request) { if (/<[a-z][\s\S]*>/i.test(suggestion.description)) { suggestion.descriptionMarkdown = suggestion.description.replace(/\n/g, ''); @@ -139,6 +140,7 @@ class PHPLanguageClient extends AutoLanguageClient { this.logger.debug(`starting "${command} ${args.join(' ')}"`) const childProcess = cp.spawn(command, args, { cwd: serverHome }) + os.setPriority(childProcess.pid, os.constants.priority.PRIORITY_BELOW_NORMAL); this.captureServerErrors(childProcess) childProcess.on('exit', exitCode => { if (exitCode != 0 && exitCode != null) {