Skip to content

Commit cba7695

Browse files
Copilotkv9898
andcommitted
Address code review feedback
- Add explicit check for 'Dark' in theme name fallback - Only fire configuration change event if theme actually changed Co-authored-by: kv9898 <[email protected]>
1 parent 2512fd0 commit cba7695

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apps/lsp/src/config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ export class ConfigurationManager extends Disposable {
181181

182182
// Fallback: try to detect theme from name if we haven't received an explicit notification yet
183183
// This is a best-effort approach for compatibility, but won't work with autoDetectColorScheme
184+
// Default to dark theme if neither Light nor Dark is in the theme name
184185
if (settings.workbench.colorTheme.includes("Light")) {
185186
this._activeColorThemeKind = "light";
187+
} else if (settings.workbench.colorTheme.includes("Dark")) {
188+
this._activeColorThemeKind = "dark";
186189
}
187190

188191
this._onDidChangeConfiguration.fire(this._settings);
@@ -212,8 +215,10 @@ export class ConfigurationManager extends Disposable {
212215
}
213216

214217
public setActiveColorThemeKind(kind: "light" | "dark") {
215-
this._activeColorThemeKind = kind;
216-
this._onDidChangeConfiguration.fire(this._settings);
218+
if (this._activeColorThemeKind !== kind) {
219+
this._activeColorThemeKind = kind;
220+
this._onDidChangeConfiguration.fire(this._settings);
221+
}
217222
}
218223

219224
public getActiveColorThemeKind(): "light" | "dark" {

0 commit comments

Comments
 (0)