implements PLN-0034 lsp inline hint transport contract

This commit is contained in:
2026-04-03 11:23:01 +01:00
parent 08f28b4a7d
commit 3e8f53dc16
10 changed files with 178 additions and 1 deletions
@@ -0,0 +1,18 @@
package p.studio.lsp.dtos;
import java.util.Objects;
public record LspInlineHintDTO(
LspRangeDTO anchor,
String label,
String category) {
public LspInlineHintDTO {
anchor = Objects.requireNonNull(anchor, "anchor");
label = Objects.requireNonNull(label, "label").trim();
category = Objects.requireNonNull(category, "category").trim();
if (label.isBlank()) {
throw new IllegalArgumentException("label cannot be blank");
}
}
}
@@ -2,6 +2,7 @@ package p.studio.lsp.messages;
import p.studio.lsp.dtos.LspDiagnosticDTO;
import p.studio.lsp.dtos.LspHighlightSpanDTO;
import p.studio.lsp.dtos.LspInlineHintDTO;
import p.studio.lsp.dtos.LspSemanticPresentationDTO;
import p.studio.lsp.dtos.LspSessionStateDTO;
import p.studio.lsp.dtos.LspStructuralAnchorDTO;
@@ -15,6 +16,7 @@ public record LspAnalyzeDocumentResult(
LspSemanticPresentationDTO semanticPresentation,
List<LspDiagnosticDTO> diagnostics,
List<LspHighlightSpanDTO> semanticHighlights,
List<LspInlineHintDTO> inlineHints,
List<LspSymbolDTO> documentSymbols,
List<LspStructuralAnchorDTO> structuralAnchors,
List<LspSymbolDTO> workspaceSymbols) {
@@ -24,6 +26,7 @@ public record LspAnalyzeDocumentResult(
Objects.requireNonNull(semanticPresentation, "semanticPresentation");
diagnostics = List.copyOf(Objects.requireNonNull(diagnostics, "diagnostics"));
semanticHighlights = List.copyOf(Objects.requireNonNull(semanticHighlights, "semanticHighlights"));
inlineHints = List.copyOf(Objects.requireNonNull(inlineHints, "inlineHints"));
documentSymbols = List.copyOf(Objects.requireNonNull(documentSymbols, "documentSymbols"));
structuralAnchors = List.copyOf(Objects.requireNonNull(structuralAnchors, "structuralAnchors"));
workspaceSymbols = List.copyOf(Objects.requireNonNull(workspaceSymbols, "workspaceSymbols"));