java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.validator.RNCValidator

public class RNCValidator extends Object
Validates RNC (RELAX NG Compact Syntax) documents in two phases.

Phase 1 — Syntax validation via RNCParser: detects structural errors (missing braces, missing assigns, unclosed blocks) and produces diagnostics with precise error ranges and specific error codes.

Phase 2 — Semantic validation via Jing's CompactParseable: detects schema-level errors (undefined patterns, duplicate definitions, missing start element) that require full schema analysis.

If Phase 1 finds errors, Phase 2 is skipped to avoid confusing duplicate diagnostics from Jing's less precise error reporting.

Use case: the editor validates the RNC document on each save or change, showing red squiggles under the problematic tokens.

See Also:
  • Constructor Details

    • RNCValidator

      public RNCValidator()
  • Method Details

    • validate

      public static List<org.eclipse.lsp4j.Diagnostic> validate(TextDocument document, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
    • validate

      public static List<org.eclipse.lsp4j.Diagnostic> validate(TextDocument document, boolean unnecessaryTagSupported, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
    • validate

      public static List<org.eclipse.lsp4j.Diagnostic> validate(TextDocument document, WorkspaceIndex workspaceIndex, boolean unnecessaryTagSupported, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)