Skip to content

feat: parent member override completion#268

Merged
calebdw merged 1 commit into
mainfrom
calebdw/push-zszvzzsptmzy
Jul 23, 2026
Merged

feat: parent member override completion#268
calebdw merged 1 commit into
mainfrom
calebdw/push-zszvzzsptmzy

Conversation

@calebdw

@calebdw calebdw commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Suggest public/protected methods, properties, and constants from parent classes and interfaces when typing a member name in a class body (protected function get, protected $attr, public const ST).

Method snippets insert a full native signature (with $ params escaped for LSP snippets) and an empty body. Property and constant inserts include parent default values when present.

#[\Override] is inserted only when supported for that member kind by the configured project PHP version (composer.json / config.platform.php):

  • methods on PHP 8.3+
  • properties on PHP 8.5+
  • constants on PHP 8.6+

Private members and ones already defined on the class are omitted. Class-name completion remains suppressed at these name positions.

Closes #267

@calebdw
calebdw force-pushed the calebdw/push-zszvzzsptmzy branch from 56f3d5e to 1d8c58f Compare July 22, 2026 21:45
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 86.78460% with 127 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/completion/context/override_completion.rs 83.68% 115 Missing ⚠️
src/completion/handler.rs 91.35% 7 Missing ⚠️
src/completion/context/type_hint_completion.rs 97.05% 3 Missing ⚠️
src/hover/member.rs 80.00% 1 Missing ⚠️
src/parser/mod.rs 97.29% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@calebdw
calebdw force-pushed the calebdw/push-zszvzzsptmzy branch 8 times, most recently from 951e1ee to 8f457dd Compare July 23, 2026 14:10
Suggest public/protected methods, properties, and constants from parent
classes and interfaces when typing a member name in a class body
(protected function get, protected $attr, public const ST).

Method snippets insert a full native signature (with $ params escaped
for LSP snippets) and an empty body. On PHP 8.3+ (composer.json /
config.platform.php), also insert #[\Override] above the declaration.
Property/const inserts include parent default values when present.

Private members and ones already defined on the class are omitted.
Class-name completion remains suppressed at these name positions.

Closes #267
@calebdw
calebdw force-pushed the calebdw/push-zszvzzsptmzy branch from 8f457dd to 9d0f399 Compare July 23, 2026 14:33
@calebdw
calebdw merged commit 4563f52 into main Jul 23, 2026
7 checks passed
@calebdw
calebdw deleted the calebdw/push-zszvzzsptmzy branch July 23, 2026 14:44
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.

Suggest parent class member overrides on code completion

2 participants