package moving
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public record BaselineDocumentAnalysis(
|
||||
List<BaselineDocumentIssue> issues) {
|
||||
|
||||
public BaselineDocumentAnalysis {
|
||||
issues = List.copyOf(Objects.requireNonNull(issues, "issues"));
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public record BaselineDocumentIssue(
|
||||
int startLine,
|
||||
int startCharacter,
|
||||
int endLine,
|
||||
int endCharacter,
|
||||
BaselineIssueSeverity severity,
|
||||
String source,
|
||||
String message) {
|
||||
|
||||
public BaselineDocumentIssue {
|
||||
severity = Objects.requireNonNull(severity, "severity");
|
||||
source = requireText(source, "source");
|
||||
message = requireText(message, "message");
|
||||
}
|
||||
|
||||
private static String requireText(
|
||||
final String value,
|
||||
final String field) {
|
||||
final String candidate = Objects.requireNonNull(value, field).trim();
|
||||
if (candidate.isEmpty()) {
|
||||
throw new IllegalArgumentException(field + " must not be blank");
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public record BaselineHover(
|
||||
String markdown) {
|
||||
|
||||
public BaselineHover {
|
||||
final String candidate = Objects.requireNonNull(markdown, "markdown").trim();
|
||||
if (candidate.isEmpty()) {
|
||||
throw new IllegalArgumentException("markdown must not be blank");
|
||||
}
|
||||
markdown = candidate;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
public enum BaselineIssueSeverity {
|
||||
INFORMATION,
|
||||
WARNING,
|
||||
ERROR
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public record BaselineServerDescription(
|
||||
String name,
|
||||
String version,
|
||||
boolean hoverSupported) {
|
||||
|
||||
public BaselineServerDescription {
|
||||
name = requireText(name, "name");
|
||||
version = requireText(version, "version");
|
||||
}
|
||||
|
||||
private static String requireText(
|
||||
final String value,
|
||||
final String field) {
|
||||
final String candidate = Objects.requireNonNull(value, field).trim();
|
||||
if (candidate.isEmpty()) {
|
||||
throw new IllegalArgumentException(field + " must not be blank");
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user