private @Nullable UsageType computeUsageType() {
    PsiFile file = getPsiFile();
    if (file == null) {
      return null;
    }
    Segment segment = getFirstSegment();
    if (segment == null) {
      return null;
    }
    Document document = PsiDocumentManager.getInstance(getProject()).getDocument(file);
    if (document == null) {
      return null;
    }
    return ChunkExtractor.getExtractor(file).deriveUsageTypeFromHighlighting(
      document.getCharsSequence(), segment.getStartOffset(), segment.getEndOffset()
    );
  }
private @Nullable UsageType computeUsageType()