MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / updateConfig

Method updateConfig

Extension/ui/settings.ts:280–323  ·  view source on GitHub ↗
(config: any)

Source from the content-addressed store, hash-verified

278 }
279
280 private updateConfig(config: any): void {
281 this.updating = true;
282 try {
283 const joinEntries: (input: any) => string = (input: string[]) => (input && input.length) ? input.join("\n") : "";
284
285 // Basic settings
286 (<HTMLInputElement>document.getElementById(elementId.configName)).value = config.name;
287 (<HTMLInputElement>document.getElementById(elementId.compilerPath)).value = config.compilerPath ?? "";
288 this.fixKnownCompilerSelection();
289 (<HTMLInputElement>document.getElementById(elementId.compilerArgs)).value = joinEntries(config.compilerArgs);
290
291 (<HTMLInputElement>document.getElementById(elementId.intelliSenseMode)).value = config.intelliSenseMode ?? "${default}";
292 (<HTMLInputElement>document.getElementById(elementId.includePath)).value = joinEntries(config.includePath);
293 (<HTMLInputElement>document.getElementById(elementId.defines)).value = joinEntries(config.defines);
294 (<HTMLInputElement>document.getElementById(elementId.cStandard)).value = config.cStandard;
295 (<HTMLInputElement>document.getElementById(elementId.cppStandard)).value = config.cppStandard;
296
297 // Advanced settings
298 (<HTMLInputElement>document.getElementById(elementId.windowsSdkVersion)).value = config.windowsSdkVersion ?? "";
299 (<HTMLInputElement>document.getElementById(elementId.macFrameworkPath)).value = joinEntries(config.macFrameworkPath);
300 (<HTMLInputElement>document.getElementById(elementId.compileCommands)).value = joinEntries(config.compileCommands);
301 (<HTMLInputElement>document.getElementById(elementId.mergeConfigurations)).checked = config.mergeConfigurations;
302 (<HTMLInputElement>document.getElementById(elementId.configurationProvider)).value = config.configurationProvider ?? "";
303 (<HTMLInputElement>document.getElementById(elementId.forcedInclude)).value = joinEntries(config.forcedInclude);
304 (<HTMLInputElement>document.getElementById(elementId.dotConfig)).value = config.dotConfig ?? "";
305 if (config.recursiveIncludes) {
306 (<HTMLInputElement>document.getElementById(elementId.recursiveIncludesPriority)).value = config.recursiveIncludes.priority ?? "${default}";
307 (<HTMLInputElement>document.getElementById(elementId.recursiveIncludesOrder)).value = config.recursiveIncludes.order ?? "${default}";
308 }
309
310 if (config.browse) {
311 (<HTMLInputElement>document.getElementById(elementId.browsePath)).value = joinEntries(config.browse.path);
312 (<HTMLInputElement>document.getElementById(elementId.limitSymbolsToIncludedHeaders)).checked =
313 config.browse.limitSymbolsToIncludedHeaders && config.browse.limitSymbolsToIncludedHeaders;
314 (<HTMLInputElement>document.getElementById(elementId.databaseFilename)).value = config.browse.databaseFilename ?? "";
315 } else {
316 (<HTMLInputElement>document.getElementById(elementId.browsePath)).value = "";
317 (<HTMLInputElement>document.getElementById(elementId.limitSymbolsToIncludedHeaders)).checked = false;
318 (<HTMLInputElement>document.getElementById(elementId.databaseFilename)).value = "";
319 }
320 } finally {
321 this.updating = false;
322 }
323 }
324
325 private updateErrors(errors: any): void {
326 this.updating = true;

Callers 1

onMessageReceivedMethod · 0.95

Calls 1

Tested by

no test coverage detected