[ai-completion] LLM-15940 add JsonSchema red-code checks for Yaml cloud completion

GitOrigin-RevId: 727a9df45b15d7a5a502d61668c654be76b632d7
This commit is contained in:
Roman Chertishchev
2025-04-11 00:41:13 +02:00
committed by intellij-monorepo-bot
parent 2a6109afe2
commit 7f67b699f6
2 changed files with 8 additions and 2 deletions

View File

@@ -42,6 +42,12 @@ public final class JsonSchemaAnnotatorChecker implements JsonValidationHost {
myErrors = new HashMap<>();
}
public JsonSchemaAnnotatorChecker(@NotNull JsonSchemaAnnotatorChecker oldChecker, Map<PsiElement, JsonValidationError> errors) {
myProject = oldChecker.myProject;
myOptions = oldChecker.myOptions;
myErrors = errors;
}
@Override
public @NotNull Map<PsiElement, JsonValidationError> getErrors() {
return myErrors;

View File

@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
public final class JsonSchemaComplianceChecker {
public class JsonSchemaComplianceChecker {
private static final Key<Set<PsiElement>> ANNOTATED_PROPERTIES = Key.create("JsonSchema.Properties.Annotated");
private final @NotNull JsonSchemaObject myRootSchema;
@@ -94,7 +94,7 @@ public final class JsonSchemaComplianceChecker {
}
}
private void createWarnings(@Nullable JsonSchemaAnnotatorChecker checker) {
protected void createWarnings(@Nullable JsonSchemaAnnotatorChecker checker) {
if (checker == null || checker.isCorrect()) return;
// compute intersecting ranges - we'll solve warning priorities based on this information
List<TextRange> ranges = new ArrayList<>();