You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PackageLoading] diagnose empty manifest separately from missing tools version specification (#5893)
This change makes it clearer to the user what problem SwiftPM thinks their manifest has, avoiding some confusions in [cases like this](https://forums.swift.org/t/missing-swift-tools-version-specification-build-fail/61051).
In the future, for errors not specific to the tools version specification, we should move their diagnostics to before calling `ToolsVersionParser.parse`. This probably requires some restructuring of manifest parsing in general.
Some additional changes:
- Removed an incorrect FIXME, and added a TODO for testing `ManifestParseError.runtimeManifestErrors`.
- Decapitalised the description for the other `ManifestParseError` cases, in keeping with [Swift’s diagnostics style](https://github.com/apple/swift/blob/3a939255c8fc1f2825560cca3a5fa6b167c414c3/docs/Diagnostics.md).
testDiagnostics(observability.diagnostics){ result in
218
-
letdiagnostic= result.check(diagnostic:.prefix("Invalid manifest\n\(path.appending(components:"MyPkg","Package.swift")):3:8: error: An error in MyPkg"), severity:.error)
218
+
letdiagnostic= result.check(diagnostic:.prefix("invalid manifest\n\(path.appending(components:"MyPkg","Package.swift")):3:8: error: An error in MyPkg"), severity:.error)
0 commit comments