@Nullable UsageType deriveUsageTypeFromHighlighting(@NotNull CharSequence chars, int usageStartOffset, int usageEndOffset) {
    Ref<UsageType> result = new Ref<>();
    processTokens(chars, usageStartOffset, usageEndOffset, (tokenStart, tokenEnd, tokenAttributeKeys) -> {
      UsageType usageType = deriveUsageTypeFromHighlighting(tokenAttributeKeys);
      if (tokenStart <= usageStartOffset) {
        result.set(usageType);
        return usageType != null;
      }
      else if (result.get() != usageType) {
        result.set(null);
        return false;
      }
      return true;
    });
    return result.get();
  }
@Nullable UsageType deriveUsageTypeFromHighlighting(@NotNull CharSequence chars, int usageStartOffset, int usageEndOffset)