diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 95e11724ea..75f2c435cf 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -577,6 +577,7 @@ const DidChangeTextEditorSelectionNotification: NotificationType = new No const ChangeCompileCommandsNotification: NotificationType = new NotificationType('cpptools/didChangeCompileCommands'); const ChangeSelectedSettingNotification: NotificationType = new NotificationType('cpptools/didChangeSelectedSetting'); const IntervalTimerNotification: NotificationType = new NotificationType('cpptools/onIntervalTimer'); +const CustomConfigurationHighPriorityNotification: NotificationType = new NotificationType('cpptools/didChangeCustomConfigurationHighPriority'); const CustomConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomConfiguration'); const CustomBrowseConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomBrowseConfiguration'); const ClearCustomConfigurationsNotification: NotificationType = new NotificationType('cpptools/clearCustomConfigurations'); @@ -2092,7 +2093,7 @@ export class DefaultClient implements Client { try { const configs: SourceFileConfigurationItem[] | undefined = await this.callTaskWithTimeout(provideConfigurationAsync, configProviderTimeout, tokenSource); if (configs && configs.length > 0) { - this.sendCustomConfigurations(configs, provider.version); + this.sendCustomConfigurations(configs, provider.version, requestFile !== undefined); } else { result = "noConfigurations"; } @@ -3019,7 +3020,7 @@ export class DefaultClient implements Client { util.isOptionalArrayOfString(input.configuration.forcedInclude); } - private sendCustomConfigurations(configs: any, providerVersion: Version): void { + private sendCustomConfigurations(configs: any, providerVersion: Version, wasRequested: boolean): void { // configs is marked as 'any' because it is untrusted data coming from a 3rd-party. We need to sanitize it before sending it to the language server. if (!configs || !(configs instanceof Array)) { console.warn("discarding invalid SourceFileConfigurationItems[]: " + configs); @@ -3085,6 +3086,9 @@ export class DefaultClient implements Client { workspaceFolderUri: this.RootUri?.toString() }; + if (wasRequested) { + void this.languageClient.sendNotification(CustomConfigurationHighPriorityNotification, params).catch(logAndReturn.undefined); + } void this.languageClient.sendNotification(CustomConfigurationNotification, params).catch(logAndReturn.undefined); }