-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Example: I have a BracketOp with a dot expression on the left side that references enum literals where I want to restrict the scope, e.g., object.myValues[A] . The expression itself is a custom concept, not coming from KernelF. The EnumLiteralRef asks the next IVisibleElementProvider for the referenceable elements. In a project, I can't change BracketOp and DotExpression, so the next IVisibleElementProvider will be up the hierarchy, and sometimes won't have enough information to provide the correct scope. In this case, myValues should provide the scope.
I propose to make DotExpression implement IVisibleElementProvider and forward the request to it's expression (not target) itself if it implements IVisibleElementProvider as well, or otherwise call the next IVisibleElementProvider up the hierachy. More generally, this could be implemented for IContainExpressionParam and the redirect would happen to IContainExpressionParam#expr. Maybe a separate marker interface would be better to not change the scopes accidentally.