Index private_class_method / public_class_method calls#780
Open
alexcrocha wants to merge 1 commit intomainfrom
Open
Index private_class_method / public_class_method calls#780alexcrocha wants to merge 1 commit intomainfrom
alexcrocha wants to merge 1 commit intomainfrom
Conversation
This was referenced May 5, 2026
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

Part of #89
This PR adds indexer support for
private_class_methodandpublic_class_methodcalls. Each call becomes aSingletonMethodVisibilityDefinitionthat the resolver applies to the singleton method declaration in a follow-up PR. This is the base of a Graphite stack.We need a definition because the indexer can't yet attach the visibility change to the singleton method:
The method declaration for
Foo::<Foo>#bar()only exists after resolution.Why a new definition type
I made it a separate type rather than adding a
receiverfield toMethodVisibilityDefinition.Foo.private_class_method :baraccepts an explicit receiver, butprivate/protected/publicdon't, soMethodVisibilityDefinitionhas no receiver field today. Addingreceiver: Option<NameId>to the existing type would cost every call site. Constant visibility made the same split.In this PR
Definition::SingletonMethodVisibilityandSingletonMethodVisibilityDefinitionprivate_class_method/public_class_methodcalls with literal symbol or string targets, with or without an explicit constant receiverNot in this PR
A few things are intentionally deferred to follow-up PRs in the stack:
handle_constant_visibilityprivate_class_method [:a, :b])private_class_method def self.foo; end)