@RequiresEdt
  protected void displayInlays(DfaResult result) {
    cleanUp();
    Map<PsiElement, DfaHint> hints = result.hints;
    Collection<TextRange> unreachable = result.unreachable;
    if (result.file == null) return;
    EditorImpl editor = ObjectUtils.tryCast(FileEditorManager.getInstance(myProject).getSelectedTextEditor(), EditorImpl.class);
    if (editor == null) return;
    VirtualFile expectedFile = result.file.getVirtualFile();
    if (expectedFile == null || !expectedFile.equals(editor.getVirtualFile())) return;
    List<Inlay<?>> newInlays = new ArrayList<>();
    List<RangeHighlighter> ranges = new ArrayList<>();
    AssistMode mode = myMode;
    if (!hints.isEmpty() && mode.displayInlays()) {
      InlayModel model = editor.getInlayModel();
      hints.forEach((expr, hint) -> {
        Segment range = expr.getTextRange();
        if (range == null) return;
        PresentationFactory factory = new PresentationFactory(editor);
        MenuOnClickPresentation presentation = new MenuOnClickPresentation(
          factory.roundWithBackground(factory.smallText(hint.getTitle())), myProject,
          () -> getInlayHintActions());
        newInlays.add(model.addInlineElement(range.getEndOffset(), new PresentationRenderer(presentation)));
      });
    }
    if (!unreachable.isEmpty() && mode.displayGrayOut()) {
      MarkupModelEx model = editor.getMarkupModel();
      for (TextRange range : unreachable) {
        RangeHighlighter highlighter = model.addRangeHighlighter(HighlightInfoType.UNUSED_SYMBOL.getAttributesKey(),
                                                                 range.getStartOffset(), range.getEndOffset(), HighlighterLayer.ERROR + 1,
                                                                 HighlighterTargetArea.EXACT_RANGE);
        ranges.add(highlighter);
      }
    }
    if (!newInlays.isEmpty() || !ranges.isEmpty()) {
      myMarkup = new DfaAssistMarkup(editor, newInlays, ranges);
    }
  }
@RequiresEdt
  protected void displayInlays(DfaResult result)