コード例 #1
0
  @Override
  public void clear(SNode node, EditorComponent editorComponent) {
    if (editorComponent.getNodeForTypechecking() == null) return;

    TypeContextManager.getInstance()
        .acquireTypecheckingContext(editorComponent.getNodeForTypechecking(), editorComponent);
    TypeContextManager.getInstance().releaseTypecheckingContext(editorComponent);
  }
コード例 #2
0
ファイル: LanguageEditorChecker.java プロジェクト: qyqx/MPS
 @Override
 public Set<EditorMessage> createMessages(
     final SNode node,
     final List<SModelEvent> list,
     final boolean wasCheckedOnce,
     final EditorContext editorContext) {
   return TypeContextManager.getInstance()
       .runTypeCheckingComputation(
           ((EditorComponent) editorContext.getEditorComponent()).getTypecheckingContextOwner(),
           node,
           new ITypechecking.Computation<Set<EditorMessage>>() {
             @Override
             public Set<EditorMessage> compute(TypeCheckingContext p0) {
               return doCreateMessages(node, list, wasCheckedOnce, editorContext);
             }
           });
 }
コード例 #3
0
 @Override
 public Set<EditorMessage> createMessages(
     final SNode rootNode,
     List<SModelEvent> events,
     final boolean wasCheckedOnce,
     final EditorContext editorContext,
     final Cancellable cancellable) {
   myMessagesChanged = false;
   return TypeContextManager.getInstance()
       .runTypeCheckingComputation(
           ((EditorComponent) editorContext.getEditorComponent()).getTypecheckingContextOwner(),
           rootNode,
           new Computation<Set<EditorMessage>>() {
             @Override
             public Set<EditorMessage> compute(final TypeCheckingContext context) {
               final Set<EditorMessage> messages = new LinkedHashSet<EditorMessage>();
               doCreateMessages(
                   context, wasCheckedOnce, editorContext, rootNode, messages, cancellable);
               return messages;
             }
           });
 }
コード例 #4
0
ファイル: PerformUtil.java プロジェクト: JetBrains/MPS
 public static void checkNodeWithTypeCheckingAction(
     final SNode node, ITypechecking.Action checkingAction) {
   ITypeContextOwner owner = new DefaultTypecheckingContextOwner();
   SNode containingRoot = node.getContainingRoot();
   TypeContextManager.getInstance().runTypeCheckingAction(owner, containingRoot, checkingAction);
 }
コード例 #5
0
 @Override
 public TypeCheckingContext createTypecheckingContext(
     SNode sNode, TypeContextManager typeContextManager) {
   return typeContextManager.createTypeCheckingContextForResolve(sNode);
 }