Package jetbrains.mps.scope
Class CompositeScope
- java.lang.Object
 - 
- jetbrains.mps.scope.Scope
 - 
- jetbrains.mps.scope.CompositeScope
 
 
 
- 
public class CompositeScope extends Scope
 
- 
- 
Constructor Summary
Constructors Constructor Description CompositeScope(Scope... scopeChain) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddScope(Scope scope)static ScopecreateComposite(Scope... scopes)Iterable<SNode>getAvailableElements(String prefix)Returns all available elements in the scope.StringgetReferenceText(SNode contextNode, SNode node)Creates textual reference for scope element.Collection<Scope>getScopes()SNoderesolve(SNode contextNode, String refText)Resolves element by reference text. 
 - 
 
- 
- 
Constructor Detail
- 
CompositeScope
public CompositeScope(Scope... scopeChain)
 
 - 
 
- 
Method Detail
- 
addScope
public void addScope(Scope scope)
 
- 
getScopes
public Collection<Scope> getScopes()
 
- 
resolve
public SNode resolve(SNode contextNode, String refText)
Description copied from class:ScopeResolves element by reference text. Invariant: getReferenceText(contextNode, resolve(contextNode, refText)) == refText 
- 
getAvailableElements
public Iterable<SNode> getAvailableElements(@Nullable String prefix)
Description copied from class:ScopeReturns all available elements in the scope.- Specified by:
 getAvailableElementsin classScope- Parameters:
 prefix- (if not null) filters out elements whose reference text doesn't start with prefix- Returns:
 - list of nodes in the scope
 
 
- 
getReferenceText
public String getReferenceText(SNode contextNode, SNode node)
Description copied from class:ScopeCreates textual reference for scope element. If element has no textual representation for the reference, returns null. Invariant: resolve(contextNode, getReferenceText(contextNode, node)) == node- Specified by:
 getReferenceTextin classScope- Parameters:
 contextNode- source node for the reference, or its nearest parent node (if source node is unavailable)node- element from the current scope (contains(node) == true)- Returns:
 - reference text for the node element in the current scope
 
 
 - 
 
 -