Interface SReferenceLink

    • Method Detail

      • getRoleName

        @Deprecated
        String getRoleName()
        Deprecated.
        Returns a name of this reference Though in 3.2 the name is still used as id in some cases, it should be treated only as a user-friendly text representation.
      • getScope

        SScope getScope​(SNode referenceNode)
        Builds and returns a scope for this reference in the given context.
        Parameters:
        referenceNode - node containing the reference, registered in the repository
      • getScope

        SScope getScope​(SNode contextNode,
                        @Nullable
                        SContainmentLink link,
                        int index)
        This method allows to build a scope for the reference before its node has been registered in the repository.

        In this case you must provide the nearest available ancestor node as a context node and the location within it where the reference will be placed.

        Example: while typing a new statement in the middle of a statement list, the context menu builds a scope before the statement has been created, in order to offer, among other things, all local variables defined up to this point in code. This is achieved by passing the statement list as a context node, "statement" link as the second parameter and the index of the statement within the statement list as the last parameter.

        Parameters:
        contextNode - the nearest ancestor of the node containing the reference
        link - containment link in the contextNode
        index - position within the link