(connection: Connection, documents: TextDocuments<AlphaTexTextDocument>)
| 11 | } from '@coderline/alphatab-language-server/server/types'; |
| 12 | |
| 13 | export function setupDiagnostics(connection: Connection, documents: TextDocuments<AlphaTexTextDocument>) { |
| 14 | connection.languages.diagnostics.on(async params => { |
| 15 | const document = documents.get(params.textDocument.uri); |
| 16 | if (document !== undefined) { |
| 17 | return { |
| 18 | kind: DocumentDiagnosticReportKind.Full, |
| 19 | items: await validateTextDocument(document) |
| 20 | } satisfies DocumentDiagnosticReport; |
| 21 | } else { |
| 22 | return { |
| 23 | kind: DocumentDiagnosticReportKind.Full, |
| 24 | items: [] |
| 25 | } satisfies DocumentDiagnosticReport; |
| 26 | } |
| 27 | }); |
| 28 | |
| 29 | documents.onDidChangeContent(async change => { |
| 30 | await validateTextDocument(change.document); |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | function mapDiagnostics(atDiag: Iterable<alphaTab.importer.alphaTex.AlphaTexDiagnostic>): Diagnostic[] { |
| 35 | const diagnostics: Diagnostic[] = []; |
no test coverage detected