Skip to content

Too few visible element providers for customization #1554

@alexanderpann

Description

@alexanderpann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions