Skip to content

Dispose decoration types left behind by palette changes - #59

Merged
MelbourneDeveloper merged 1 commit into
mainfrom
fix/decoration-palette
Nov 18, 2026
Merged

MelbourneDeveloper merged 1 commit into
mainfrom
fix/decoration-palette

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

Fixes a LOW item from the v0.6.0 leak review, which #56 wrongly judged bounded. Both decoration maps are keyed by colour, and the palette is re-read from settings on every render, so each palette change left the previous colours' decoration types allocated for the rest of the session.

Test first: decoration-palette.test.ts changes the lspui.profiler.palette setting 8 times and paints a hot line after each change. Before the fix it failed with 9 decoration types allocated after 8 palette changes.

Fix: a new pruneToPalette disposes the types whose colour the current palette no longer uses. It runs whenever a type for a new colour is created, in both the heat and the memory decorations.

Verification: npm run lint passes; the VS Code UI suite (191), the teardown suite (1) and the unit tests (117) pass.

@MelbourneDeveloper
MelbourneDeveloper merged commit 8c13ac6 into main Nov 18, 2026
10 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the fix/decoration-palette branch November 18, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant