perf: check sentiment before state to avoid unnecessary computation

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-06 12:13:15 +00:00
committed by Henning Dieterichs
parent 7704adeb3e
commit c308cc9f87
@@ -54,17 +54,17 @@ export class InlineCompletionLanguageStatusBarContribution extends Disposable im
});
this._register(autorunWithStore((reader, store) => {
const state = this._state.read(reader);
if (!state) {
return;
}
// Do not show the Copilot icon in the language status when AI features are disabled
const sentiment = this._sentiment.read(reader);
if (sentiment.hidden) {
return;
}
const state = this._state.read(reader);
if (!state) {
return;
}
const status = state.status.read(reader);
const statusMap: Record<typeof status, { shortLabel: string; label: string; loading: boolean }> = {