Skip to content

Commit 951f442

Browse files
committed
Finish plugging into config UI
1 parent ab635e9 commit 951f442

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Extension/src/LanguageServer/settingsPanel.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const elementId: { [key: string]: string } = {
5252
mergeConfigurations: "mergeConfigurations",
5353
configurationProvider: "configurationProvider",
5454
forcedInclude: "forcedInclude",
55+
recursiveIncludesReduce: "recursiveIncludes.reduce",
56+
recursiveIncludesPriority: "recursiveIncludes.priority",
5557

5658
// Browse properties
5759
browsePath: "browsePath",
@@ -351,6 +353,18 @@ export class SettingsPanel {
351353
case elementId.forcedInclude:
352354
this.configValues.forcedInclude = splitEntries(message.value);
353355
break;
356+
case elementId.recursiveIncludesReduce:
357+
if (!this.configValues.recursiveIncludes) {
358+
this.configValues.recursiveIncludes = {};
359+
}
360+
this.configValues.recursiveIncludes.reduce = message.value;
361+
break;
362+
case elementId.recursiveIncludesPriority:
363+
if (!this.configValues.recursiveIncludes) {
364+
this.configValues.recursiveIncludes = {};
365+
}
366+
this.configValues.recursiveIncludes.priority = message.value;
367+
break;
354368
case elementId.browsePath:
355369
if (!this.configValues.browse) {
356370
this.configValues.browse = {};

Extension/ui/settings.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const elementId: { [key: string]: string } = {
4242
mergeConfigurations: "mergeConfigurations",
4343
dotConfig: "dotConfig",
4444
dotConfigInvalid: "dotConfigInvalid",
45+
recursiveIncludesReduce: "recursiveIncludes.reduce",
46+
recursiveIncludesPriority: "recursiveIncludes.priority",
4547

4648
// Browse properties
4749
browsePath: "browsePath",
@@ -103,6 +105,7 @@ class SettingsApp {
103105
// Special case for checkbox elements
104106
document.getElementById(elementId.limitSymbolsToIncludedHeaders)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.limitSymbolsToIncludedHeaders));
105107
document.getElementById(elementId.mergeConfigurations)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.mergeConfigurations));
108+
document.getElementById(elementId.recursiveIncludesReduce)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.recursiveIncludesReduce));
106109
}
107110

108111
private addEventsToConfigNameChanges(): void {
@@ -300,6 +303,10 @@ class SettingsApp {
300303
(<HTMLInputElement>document.getElementById(elementId.configurationProvider)).value = config.configurationProvider ? config.configurationProvider : "";
301304
(<HTMLInputElement>document.getElementById(elementId.forcedInclude)).value = joinEntries(config.forcedInclude);
302305
(<HTMLInputElement>document.getElementById(elementId.dotConfig)).value = config.dotConfig ? config.dotConfig : "";
306+
if (config.recursiveIncludes) {
307+
(<HTMLInputElement>document.getElementById(elementId.recursiveIncludesReduce)).checked = config.recursiveIncludes.reduce;
308+
(<HTMLInputElement>document.getElementById(elementId.recursiveIncludesPriority)).value = config.recursiveIncludes.priority;
309+
}
303310

304311
if (config.browse) {
305312
(<HTMLInputElement>document.getElementById(elementId.browsePath)).value = joinEntries(config.browse.path);

0 commit comments

Comments
 (0)