@Nullable
  CodeFoldingState getFoldingState() {
    // Assuming single-thread access here.
    if (myFoldingState == null && delayedFoldInfoProducer != null) {
      myFoldingState = delayedFoldInfoProducer.get();
      if (myFoldingState != null) {
        delayedFoldInfoProducer = null;
      }
    }
    return myFoldingState;
  }
@Nullable
  CodeFoldingState getFoldingState()