void readExternal(@NotNull Element element) {
    ApplicationManager.getApplication().runReadAction(() -> {
      clear();

      if (!file.isValid()) {
        return;
      }

      Document document = FileDocumentManager.getInstance().getDocument(file);
      if (document == null) {
        return;
      }

      // IDEA-313274 Remove persisted visual formatting foldings from workspace files
      WhiteSpaceFormattingStrategy whiteSpaceFormattingStrategy = WhiteSpaceFormattingStrategyFactory.DEFAULT_STRATEGY;
      boolean removeVFmtZombieFoldings = VisualFormattingLayerService.shouldRemoveZombieFoldings();

      String date = null;
      for (Element e : element.getChildren()) {
        String signature = e.getAttributeValue(SIGNATURE_ATT);
        if (signature == null) {
          continue;
        }

        boolean expanded = Boolean.parseBoolean(e.getAttributeValue(EXPANDED_ATT));
        if (ELEMENT_TAG.equals(e.getName())) {
          myInfos.add(new Info(signature, expanded));
        }
        else if (MARKER_TAG.equals(e.getName())) {
          if (date == null) {
            date = getTimeStamp();
          }
          if (date.isEmpty()) {
            continue;
          }

          if (!date.equals(e.getAttributeValue(DATE_ATT)) || FileDocumentManager.getInstance().isDocumentUnsaved(document)) {
            continue;
          }

          StringTokenizer tokenizer = new StringTokenizer(signature, ":");
          try {
            int start = Integer.valueOf(tokenizer.nextToken()).intValue();
            int end = Integer.valueOf(tokenizer.nextToken()).intValue();
            if (start < 0 || end >= document.getTextLength() || start > end) continue;
            String placeholderAttributeValue = e.getAttributeValue(PLACEHOLDER_ATT);
            String placeHolderText = placeholderAttributeValue == null ? DEFAULT_PLACEHOLDER
                                                                       : XmlStringUtil.unescapeIllegalXmlChars(placeholderAttributeValue);

            // IDEA-313274 Remove persisted visual formatting foldings from workspace files
            if (removeVFmtZombieFoldings &&
                placeHolderText.isEmpty() &&
                whiteSpaceFormattingStrategy.check(document.getText(), start, end) >= end) {
              continue;
            }

            RangeMarker marker = document.createRangeMarker(start, end);
            myRangeMarkers.add(marker);
            FoldingInfo fi = new FoldingInfo(placeHolderText, expanded);
            marker.putUserData(FOLDING_INFO_KEY, fi);
          }
          catch (NoSuchElementException exc) {
            LOG.error(exc);
          }
        }
        else {
          throw new IllegalStateException("unknown tag: " + e.getName());
        }
      }
    });
  }
void readExternal(@NotNull Element element)