Skip to content

Commit 468a0e1

Browse files
committed
Lower memory use when flattening generic class hierarchies
1 parent e8ce13c commit 468a0e1

6 files changed

Lines changed: 249 additions & 486 deletions

File tree

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535

3636
### Changed
3737

38+
- **Lower memory use when flattening generic class hierarchies.** Resolving a subclass of a generic base class no longer copies every inherited method and property. Members that do not mention a generic type parameter are now shared with the base class instead of being cloned and rewritten. On large Laravel projects, where nearly every Eloquent model resolves through a generic base, this substantially shrinks the resolved-class cache during workspace analysis and speeds up the merge itself.
3839
- **Classes are pre-resolved for the whole workspace after startup.** Once the background index completes, every known class is resolved in dependency order even when workspace diagnostics are disabled, so the first completion, hover, or go-to-definition against any class reads a warm cache instead of resolving on demand. Edits still re-resolve only the affected classes.
3940
- **Continuous progress reporting.** The indexing progress bar now advances file by file with live counts (e.g. "Scanning vendor packages (3201/8544 files)") instead of jumping between a few fixed milestones. This covers single-project, monorepo, and non-Composer workspaces. Go to Implementation, Find References, and Type Hierarchy show the same live progress while they scan, including when one of them triggers the first full workspace index.
4041
- **Property hover now shows effective types as a `var` detail line.** Property hovers now mirror method hovers by displaying the resolved/effective property type above the PHP snippet as `**var**`, while the snippet itself shows only the native PHP property declaration. This keeps docblock-inferred, virtual, and schema-derived property types out of the generated signature block. Contributed by @calebdw.

docs/todo.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ within the same impact tier.
2525

2626
| # | Item | Impact | Effort |
2727
| --- | --------------------------------------------------------------------------------------------------------------------- | ---------- | ------ |
28-
| ER5 | [Mago-style separated metadata](todo/eager-resolution.md#er5-mago-style-separated-metadata) | High | High |
28+
| P36 | [Diagnostic-path call sites re-merge inheritance per call](todo/performance.md#p36-diagnostic-path-call-sites-re-merge-inheritance-per-call-instead-of-reading-the-resolved-class-cache) | Medium | Low |
2929
| P31 | [Reference index stores per-span entries when consumers only read distinct URIs](todo/performance.md#p31-reference-index-stores-per-span-entries-when-consumers-only-read-distinct-uris) | Medium | Low-Medium |
3030
| P33 | [Workspace diagnostics leaves the whole project fully resolved in memory](todo/performance.md#p33-workspace-diagnostics-leaves-the-whole-project-fully-resolved-in-memory) | High | Medium-High |
3131
| X10 | [Interactive requests block on the workspace index lock during initial indexing](todo/indexing.md#x10-interactive-requests-block-on-the-workspace-index-lock-during-initial-indexing) | Medium | Medium |
@@ -174,7 +174,6 @@ unlikely to move the needle for most users.
174174
| L25 | [Storage disk name strings](todo/laravel.md#l25-storage-disk-name-strings) | Low-Medium | Low |
175175
| L31 | [String-key rename, highlight, and semantic tokens](todo/laravel.md#l31-string-key-rename-highlight-and-semantic-tokens) | Low-Medium | Low-Medium |
176176
| L29 | [Livewire and Volt component names](todo/laravel.md#l29-livewire-and-volt-component-names) | Low-Medium | Medium |
177-
| L33 | [Artisan command and signature strings](todo/laravel.md#l33-artisan-command-and-signature-strings) | Low-Medium | Medium |
178177
| L3 | `$dates` array (deprecated) | Low-Medium | Low |
179178
| L12 | [`HasUuids` / `HasUlids` trait — `$id` typed as `string`](todo/laravel.md#l12-hasuuids-hasulids-trait-id-typed-as-string) | Low-Medium | Low |
180179
| L6 | Factory `has*`/`for*` relationship methods | Low-Medium | Medium |
@@ -195,7 +194,7 @@ unlikely to move the needle for most users.
195194
| | **[External Stubs](todo/external-stubs.md)** | | |
196195
| E6 | Stub install prompt for non-Composer projects | Low | Low |
197196
| E7 | [Stub-based framework patches](todo/external-stubs.md#e7-stub-based-framework-patches) | Medium | Medium |
198-
| | **[Performance](todo/performance.md) / [Eager Resolution](todo/eager-resolution.md)** | | |
197+
| | **[Performance](todo/performance.md)** | | |
199198
| P29 | [Migrate to `mago-phpdoc-syntax`](todo/performance.md#p29-migrate-to-mago-phpdoc-syntax) (drop deprecated `mago-docblock` / `mago-type-syntax`) | Medium | Medium |
200199
| P30 | [Evaluate migrating parse/resolve/docblock pipeline to `mago-hir`](todo/performance.md#p30-evaluate-migrating-parseresolvedocblock-pipeline-to-mago-hir) (blocked on upstream API stabilizing — see triggers) | Medium-High | High |
201200
| P16 | [Pre-parsed stub format (eliminate raw PHP embedding)](todo/performance.md#p16-pre-parsed-stub-format-eliminate-raw-php-embedding) | High | Medium-High |

0 commit comments

Comments
 (0)