(ctx context.Context, sourceFile *ast.SourceFile)
| 602 | } |
| 603 | |
| 604 | func (p *Program) GetSyntacticDiagnostics(ctx context.Context, sourceFile *ast.SourceFile) []*ast.Diagnostic { |
| 605 | return p.collectDiagnostics(ctx, sourceFile, false /*concurrent*/, func(_ context.Context, file *ast.SourceFile) []*ast.Diagnostic { |
| 606 | diags := core.Concatenate(file.Diagnostics(), file.JSDiagnostics()) |
| 607 | // For JS files that won't be checked by the checker (no checkJs/ts-check), we need |
| 608 | // program-level syntactic checks that require compiler options. This mirrors Strada's |
| 609 | // getJSSyntacticDiagnosticsForFile in program.ts. |
| 610 | if ast.IsSourceFileJS(file) && !ast.IsCheckJSEnabledForFile(file, p.Options()) { |
| 611 | diags = append(diags, getAdditionalJSSyntacticDiagnostics(file, p.Options())...) |
| 612 | } |
| 613 | return diags |
| 614 | }) |
| 615 | } |
| 616 | |
| 617 | // getAdditionalJSSyntacticDiagnostics produces option-dependent syntactic diagnostics for JS files |
| 618 | // that aren't covered by the parser or the checker. In Strada, the equivalent logic lives in |
nothing calls this directly
no test coverage detected