Skip to content

Fix singleton class lifecycle cleanup#776

Open
st0012 wants to merge 1 commit intomainfrom
fix-singleton-lifecycle
Open

Fix singleton class lifecycle cleanup#776
st0012 wants to merge 1 commit intomainfrom
fix-singleton-lifecycle

Conversation

@st0012
Copy link
Copy Markdown
Member

@st0012 st0012 commented May 1, 2026

Summary

Fixes singleton class lifecycle cleanup during document deletion and re-indexing. Singleton classes are now pruned only when they are no longer anchored by definitions, members, constant references, or surviving extend mixins on their attached object.

The cleanup path is split into focused steps for method references, constant references, unmapped definitions, raw definition entries, and declaration pruning. Removability is checked through the graph so singleton classes can account for external anchors, while TODO parents are not kept alive by unresolved references alone.

The invalidation worklist now keeps declaration lifecycle modes under InvalidationItem::Declaration { id, reason }, so declaration-specific invalidation reasons stay localized instead of widening the top-level work item enum.

@st0012 st0012 force-pushed the fix-singleton-lifecycle branch 3 times, most recently from 54bc228 to 5dc2e67 Compare May 1, 2026 15:25
@st0012 st0012 marked this pull request as ready for review May 1, 2026 15:27
@st0012 st0012 requested a review from a team as a code owner May 1, 2026 15:27
@st0012 st0012 added the bugfix A change that fixes an existing bug label May 1, 2026
@st0012 st0012 self-assigned this May 1, 2026
@st0012 st0012 force-pushed the fix-singleton-lifecycle branch from 5dc2e67 to 1ba8c9c Compare May 3, 2026 14:33
Comment thread rust/rubydex/src/model/graph.rs
Comment thread rust/rubydex/src/model/graph.rs Outdated
Comment thread rust/rubydex/src/model/graph.rs Outdated
@st0012 st0012 force-pushed the fix-singleton-lifecycle branch from 1ba8c9c to 613bc62 Compare May 4, 2026 01:25
Comment thread rust/rubydex/src/model/graph.rs Outdated
@st0012 st0012 force-pushed the fix-singleton-lifecycle branch from 613bc62 to 7bf434b Compare May 4, 2026 02:05
Comment thread rust/rubydex/src/model/graph.rs Outdated
Comment thread rust/rubydex/src/model/graph.rs Outdated
Comment thread rust/rubydex/src/model/graph.rs
@st0012 st0012 force-pushed the fix-singleton-lifecycle branch 8 times, most recently from a2ac367 to d83e97c Compare May 4, 2026 05:17
@st0012 st0012 force-pushed the fix-singleton-lifecycle branch from d83e97c to f5dff8a Compare May 4, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant