Reduce settings change noise (#14622)

This commit is contained in:
Bob Brown
2026-07-30 20:06:34 +00:00
committed by GitHub
parent 7c6aa892b4
commit b17d9bd94d
2 changed files with 8 additions and 2 deletions
+4 -2
View File
@@ -38,7 +38,7 @@ import { CppConfigurationLanguageModelTool } from './lmTool';
import { getLocaleId } from './localization';
import { PersistentState } from './persistentState';
import { NodeType, TreeNode } from './referencesModel';
import { CppSettings } from './settings';
import { CppSettings, trackedSections } from './settings';
import { LanguageStatusUI, getUI } from './ui';
import { makeLspRange, rangeEquals, showInstallCompilerWalkthrough } from './utils';
@@ -293,7 +293,9 @@ export function updateLanguageConfigurations(): void {
async function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): Promise<void> {
clients.forEach(client => {
if (client instanceof DefaultClient) {
void client.onDidChangeSettings(event).catch(logAndReturn.undefined);
if (trackedSections.some(section => event.affectsConfiguration(section, client.RootUri))) {
void client.onDidChangeSettings(event).catch(logAndReturn.undefined);
}
}
});
}
+4
View File
@@ -32,6 +32,10 @@ export interface Associations {
[key: string]: string;
}
// The settings sections that we provide accessors for.
// This is used to filter out settings changed events that do not impact the extension.
export const trackedSections: string[] = ['C_Cpp', 'editor', 'files', 'search', 'workbench'];
// Settings that can be undefined have default values assigned in the native code or are meant to return undefined.
export interface WorkspaceFolderSettingsParams {
uri: string | undefined;