/** * Manifest Diagnostics Service for DomainLang. * * Provides LSP diagnostics for model.yaml files by integrating the ManifestValidator * with the VS Code language server protocol. * * This service: * - Validates model.yaml files using ManifestValidator * - Converts ManifestDiagnostic to LSP Diagnostic format * - Sends diagnostics to the LSP connection * * @module */ import type { Connection } from 'vscode-languageserver'; import { Diagnostic } from 'vscode-languageserver-types'; /** * Service for validating model.yaml and sending diagnostics via LSP. */ export declare class ManifestDiagnosticsService { private readonly validator; private connection; /** * Sets the LSP connection for sending diagnostics. * Must be called before validateAndSendDiagnostics. */ setConnection(connection: Connection): void; /** * Validates a model.yaml file and sends diagnostics to the LSP connection. * * @param manifestUri - URI of the model.yaml file * @param content - Raw YAML content of the file * @param options - Validation options */ validateAndSendDiagnostics(manifestUri: string, content: string, options?: { requirePublishable?: boolean; }): Promise; /** * Validates manifest content and returns LSP diagnostics. * * @param content - Raw YAML content * @param options - Validation options * @returns Array of LSP diagnostics */ validate(content: string, options?: { requirePublishable?: boolean; }): Diagnostic[]; /** * Converts a YAML error to an LSP Range. */ private yamlErrorToRange; /** * Clears diagnostics for a manifest file. * Call this when the file is closed or deleted. */ clearDiagnostics(manifestUri: string): Promise; /** * Converts a ManifestDiagnostic to an LSP Diagnostic. */ private toVSCodeDiagnostic; /** * Converts ManifestSeverity to LSP DiagnosticSeverity. */ private toVSCodeSeverity; /** * Finds the source range for a YAML path like "dependencies.core.version". * Returns a fallback range at start of file if path not found. */ private findRangeForPath; /** * Converts byte offsets to a VS Code Range using line/column calculation. */ private offsetsToRange; } /** * Gets or creates the manifest diagnostics service singleton. */ export declare function getManifestDiagnosticsService(): ManifestDiagnosticsService; /** * Helper to validate a manifest URI with the given content. * Convenience function for use in file watchers. */ export declare function validateManifestFile(connection: Connection, manifestUri: string, content: string): Promise;