@Nullable
  private static Context createContext(@NotNull Editor editor,
                                       int offset,
                                       long startTimestamp,
                                       boolean showImmediately,
                                       boolean showDocumentation) {
    Project project = Objects.requireNonNull(editor.getProject());

    HighlightInfo info = null;
    if (!Registry.is("ide.disable.editor.tooltips")) {
      DaemonCodeAnalyzerImpl daemonCodeAnalyzer = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(project);
      boolean highestPriorityOnly = !Registry.is("ide.tooltip.showAllSeverities");
      info = daemonCodeAnalyzer
        .findHighlightsByOffset(editor.getDocument(), offset, false, highestPriorityOnly, HighlightInfoType.SYMBOL_TYPE_SEVERITY);
    }

    PsiElement elementForQuickDoc = findElementForQuickDoc(editor, offset, project);
    return info == null && elementForQuickDoc == null
           ? null
           : new Context(startTimestamp, offset, info, elementForQuickDoc, showImmediately, showDocumentation);
  }
@Nullable
  private static Context createContext(@NotNull Editor editor,
                                       int offset,
                                       long startTimestamp,
                                       boolean showImmediately,
                                       boolean showDocumentation)