Index calls to private_constant and public_constant#506
Index calls to private_constant and public_constant#506
private_constant and public_constant#506Conversation
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
private_constant and public_constant
|
I like the idea of storing the visibility calls so that we can process them correctly during resolution, but I wonder if we need a new concept here other than definition. This is a very similar case as #362, where we would also like to remember this for resolution. It seems that these cases mutate existing definitions. What do you think of having a separate concept for this? Maybe a new |
The thing is, I want the |
I think these should appear in find references (which is the same as rename), but not go to definition. I'd find it surprising if going to definition would take me to a Foo.private_const(:Bar)
# ^ constant reference to Foo
# ^ constant reference to BarI'd expect these to show up when finding references, but not when going to definition. I see it as something like this: enum Operation {
PrivateConstant,
Mixin,
}
struct Directive {
receiver: ReferenceId,
target: ReferenceId,
operation: Operation
}This would also support |
How would we link it back from the declaration? We add a new |
One more step towards #89 and #354. We start keeping track of calls to
private_constantandpublic_constant.For these ones I chose to keep a new definition around because we'll need to resolve the names to be able to apply the visibility to the right constant.
Take this code for example:
there is no way to handle it within the indexer.