()
| 1232 | } |
| 1233 | |
| 1234 | func (p *Program) verifyProjectReferences() { |
| 1235 | buildInfoFileName := core.IfElse(!p.Options().SuppressOutputPathCheck.IsTrue(), p.opts.Config.GetBuildInfoFileName(), "") |
| 1236 | createDiagnosticForReference := func(config *tsoptions.ParsedCommandLine, index int, message *diagnostics.Message, args ...any) { |
| 1237 | diag := tsoptions.CreateDiagnosticAtReferenceSyntax(config, index, message, args...) |
| 1238 | if diag == nil { |
| 1239 | diag = ast.NewCompilerDiagnostic(message, args...) |
| 1240 | } |
| 1241 | p.programDiagnostics = append(p.programDiagnostics, diag) |
| 1242 | } |
| 1243 | |
| 1244 | p.RangeResolvedProjectReference(func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) bool { |
| 1245 | ref := parent.ProjectReferences()[index] |
| 1246 | // !!! Deprecated in 5.0 and removed since 5.5 |
| 1247 | // verifyRemovedProjectReference(ref, parent, index); |
| 1248 | if config == nil { |
| 1249 | createDiagnosticForReference(parent, index, diagnostics.File_0_not_found, ref.Path) |
| 1250 | return true |
| 1251 | } |
| 1252 | refOptions := config.CompilerOptions() |
| 1253 | if !refOptions.Composite.IsTrue() || refOptions.NoEmit.IsTrue() { |
| 1254 | if len(parent.FileNames()) > 0 { |
| 1255 | if !refOptions.Composite.IsTrue() { |
| 1256 | createDiagnosticForReference(parent, index, diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.Path) |
| 1257 | } |
| 1258 | if refOptions.NoEmit.IsTrue() { |
| 1259 | createDiagnosticForReference(parent, index, diagnostics.Referenced_project_0_may_not_disable_emit, ref.Path) |
| 1260 | } |
| 1261 | } |
| 1262 | } |
| 1263 | if buildInfoFileName != "" && buildInfoFileName == config.GetBuildInfoFileName() { |
| 1264 | createDiagnosticForReference(parent, index, diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoFileName, ref.Path) |
| 1265 | p.hasEmitBlockingDiagnostics.Add(p.toPath(buildInfoFileName)) |
| 1266 | } |
| 1267 | return true |
| 1268 | }) |
| 1269 | } |
| 1270 | |
| 1271 | func hasZeroOrOneAsteriskCharacter(str string) bool { |
| 1272 | seenAsterisk := false |
no test coverage detected