(atDiag: Iterable<alphaTab.importer.alphaTex.AlphaTexDiagnostic>)
| 32 | } |
| 33 | |
| 34 | function mapDiagnostics(atDiag: Iterable<alphaTab.importer.alphaTex.AlphaTexDiagnostic>): Diagnostic[] { |
| 35 | const diagnostics: Diagnostic[] = []; |
| 36 | for (const d of atDiag) { |
| 37 | const diagnostic: Diagnostic = { |
| 38 | severity: DiagnosticSeverity.Warning, |
| 39 | range: { |
| 40 | start: { |
| 41 | line: d.start!.line - 1, |
| 42 | character: d.start!.col - 1 |
| 43 | }, |
| 44 | end: { |
| 45 | line: d.end!.line - 1, |
| 46 | character: d.end!.col - 1 |
| 47 | } |
| 48 | }, |
| 49 | message: d.message, |
| 50 | code: `AT${d.code}`, |
| 51 | source: 'alphaTab' |
| 52 | }; |
| 53 | switch (d.severity) { |
| 54 | case alphaTab.importer.alphaTex.AlphaTexDiagnosticsSeverity.Hint: |
| 55 | diagnostic.severity = DiagnosticSeverity.Hint; |
| 56 | break; |
| 57 | case alphaTab.importer.alphaTex.AlphaTexDiagnosticsSeverity.Warning: |
| 58 | diagnostic.severity = DiagnosticSeverity.Warning; |
| 59 | break; |
| 60 | case alphaTab.importer.alphaTex.AlphaTexDiagnosticsSeverity.Error: |
| 61 | diagnostic.severity = DiagnosticSeverity.Error; |
| 62 | break; |
| 63 | } |
| 64 | diagnostics.push(diagnostic); |
| 65 | } |
| 66 | return diagnostics; |
| 67 | } |
| 68 | function handleError(e: Error): Diagnostic[] { |
| 69 | let atError: alphaTab.importer.AlphaTexErrorWithDiagnostics | undefined; |
| 70 | if (e instanceof alphaTab.importer.AlphaTexErrorWithDiagnostics) { |
no test coverage detected