Skip to content

Commit bc5722c

Browse files
author
Akos Kitta
committed
feat: flag to limit the thread count used by LS
Ref: arduino/arduino-language-server#177 Signed-off-by: Akos Kitta <[email protected]>
1 parent 1437f94 commit bc5722c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: src/ino.ts

+9
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ export interface StartLanguageServerParams {
5555
* If `true`, the logging is not forwarded to the _Output_ view via the language client.
5656
*/
5757
readonly silentOutput?: boolean;
58+
/**
59+
* Number of async workers used by `clangd`. Background index also uses this many workers. If `0`, `clangd` uses all available cores. It's `0` by default.
60+
*/
61+
readonly jobs?: number;
5862
}
5963

6064
/**
@@ -177,6 +181,7 @@ async function buildLanguageClient(
177181
flags,
178182
env,
179183
log,
184+
jobs,
180185
} = config;
181186
const args = [
182187
'-clangd',
@@ -216,6 +221,10 @@ async function buildLanguageClient(
216221
args.push('-logpath', logPath);
217222
}
218223
}
224+
// https://github.com/arduino/arduino-language-server/pull/177
225+
if (jobs) {
226+
args.push('-jobs', String(jobs));
227+
}
219228
const clientOptions: LanguageClientOptions = {
220229
initializationOptions: {},
221230
documentSelector: ['ino', 'c', 'cpp', 'cc', 'cxx', 'h', 'hpp', 'pde'],

0 commit comments

Comments
 (0)