Hide implicit self from __call signature help - #1613
Open
Companion wants to merge 1 commit into
Open
Conversation
…hods The table being called is bound to the metamethod's first parameter, so the caller never supplies it. Drop it from the label and the reported parameters, while keeping the original index when looking up parameter documentation. Fixes JohnnyMorganz#1597
Companion
force-pushed
the
fix/signature-help-call-metamethod-self
branch
from
August 31, 2026 20:57
6ee573f to
af8243a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Signature help for a table invoked through its
__callmetamethod includes the first metamethod parameter:Luau supplies
selfimplicitly, so callers cannot provide it. However, signature help currently displays:and reports both values as caller provided parameters.
Change
Build
__callsignature help from a copy of the metamethod type with its implicit first argument removed. The corrected signature is:This removes
selffrom both the displayed label and the LSP parameter list while preserving parameter offsets, active parameter tracking and documentation indices for the remaining arguments.Ordinary function calls and existing method call (
:) behaviour are unchanged. The separate method call label behaviour tracked by #1250 remains outside the scope of this change.Fixes #1597.
Testing
Added focused signature help tests covering:
__callmetamethods containing onlyselfThe new tests were verified to be load bearing by temporarily disabling the trimming and documentation offset behaviour.