Reduce settings change noise (#14622)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user