Skip to content

Guard theme colors to prevent activation crash#12951

Open
SparshGarg999 wants to merge 2 commits into
continuedev:mainfrom
SparshGarg999:fix/color-palette-activation-failure
Open

Guard theme colors to prevent activation crash#12951
SparshGarg999 wants to merge 2 commits into
continuedev:mainfrom
SparshGarg999:fix/color-palette-activation-failure

Conversation

@SparshGarg999

Copy link
Copy Markdown

Description

This PR resolves issue #12947 where the extension fails to activate when using non-standard or custom color palettes.

Specifically, accessing this.theme.colors["editor.background"] or this.theme.colors["editor.foreground"] throws TypeError: Cannot read properties of undefined (reading 'editor.background') if this.theme.colors is undefined.

Optional chaining (?.) has been added to guard these theme property lookups in both InlineTipManager.ts and JumpManager.ts, falling back safely to default stroke/background colors when theme colors are unavailable.

Test Plan

  1. Switch to a custom/non-standard theme that does not declare VS Code token colors in the usual format.
  2. Activate the Continue extension.
  3. Observe that the extension starts up successfully without crashing during tooltip generation.

@SparshGarg999 SparshGarg999 requested a review from a team as a code owner July 6, 2026 13:17
@SparshGarg999 SparshGarg999 requested review from sestinj and removed request for a team July 6, 2026 13:17
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@SparshGarg999

Copy link
Copy Markdown
Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant