Child pages
  • Constraints

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
search scope
search scope

search scope - defines the set of nodes to which this link can point. The method can return either a sequence<node<>> or ISearchScope interface implementation can be returned from this method.

parameter

description

model

the model that contains the node with the link. This is just included for convenience - it can be taken from either referenceNode or enclosingNode, since both referenceNode and enclosingNode keep the model too.

scope

IScope interface that shows models, languages and devkits you can see from the code.

referenceNode

the node that contains the actual link, . It can be null when a new node is being created for a concept with smart reference. In this situation smart reference is used to determine what type of node to create in the context of enclosingNode, so the search scope method is called with a null referenceNode.

enclosingNode

parent of the node that contains the actual link, null for root nodes. Both referenceNode and enclosingNode cannot be null at the same time.

linkTarget

the concept that this link can refer to. Usually it is a concept of the reference, so it is known statically. If we specialize reference in subconcept and do not define search scope for specialized reference, then linkTarget parameter can be used to determine what reference specialization is required.

...

Anchor
validator
validator

validator (since 1.5) - Each reference is checked against it's search scope and if reference goes , after changes in the model, a reference ends up pointing out of the search scope after changes in model the , MPS marks such a reference with the an error message. Sometimes it is not efficient to build the whole search scope just to check if the reference is in scope. The search scope can be big or it may be much easier to check if the given node is in scope than to calculate what nodes are in scope. You can create quick reference check procedure here to speed up reference validation in such situations.

...

Anchor
presentation
presentation

presentation - here you specify how the reference will look like in the editor and in the completion list. Sometimes it is convenient to show reference differently depending on context. For example, in Java language reference all references to the an instance field f should be shown as this.f, if it the field is being shadowed by the local variable declaration with the same name. If By default, if no presentation is not set, then the name of the reference node will be used as its presentation (if provided it is an INamedConcept).

parameter

description

model
scope
referenceNode
enclosingNode
linkTarget

the context of reference usage, the same meaning as in the search scope function.

parameterNode

the node to be presented (referenceNode has a reference to parameterNode of type linkTarget)

visible

true - presentation of existing node, false - for new node (to be created after selection in completion menu)

smartReference

true - node is presented in the smart reference

inEditor

true - presentation for editor, false - for completion menu

...