package p.studio.compiler.services;

import p.studio.compiler.source.Span;

import java.util.Objects;

public record PbsInlineHintSurface(
        Span anchorSpan,
        String label,
        String category) {

    public PbsInlineHintSurface {
        anchorSpan = Objects.requireNonNull(anchorSpan, "anchorSpan");
        label = Objects.requireNonNull(label, "label").trim();
        category = Objects.requireNonNull(category, "category").trim();
        if (label.isBlank()) {
            throw new IllegalArgumentException("label cannot be blank");
        }
        if (category.isBlank()) {
            throw new IllegalArgumentException("category cannot be blank");
        }
    }
}
