Skip to content

Use SwiftIfConfig to determine where to emit new parser diagnostics #76074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 24, 2024

Conversation

DougGregor
Copy link
Member

Re-establish the use of SwiftIfConfig to determine where to emit new parser diagnostics, after it was reverted in #76040. This leverages improvements to SwiftIfConfig that match the evaluation semantics of the compiler as well as providing better source-location information.

Switch to the new `canImport` API that includes TokenSyntax nodes for each
import path, so we can provide better source locations. We no longer need
to stuff a random source location into `CompilerBuildConfiguration`.

Make use of `ConfiguredRegions.isActive(_:)` directly instead of going
through the older entrypoint.

When parser validation is enabled, we currently can end up with duplicated
diagnostics from canImport. This is going to require some requestification
to address.
@DougGregor
Copy link
Member Author

swiftlang/swift-syntax#2819

@swift-ci please smoke test

Since these duplicated diagnostics only occur under the ParserValidation
testing mode, it won't affect users yet.
@DougGregor
Copy link
Member Author

swiftlang/swift-syntax#2819

@swift-ci please smoke test

@DougGregor DougGregor merged commit 6b6e9aa into swiftlang:main Aug 24, 2024
3 checks passed
@DougGregor DougGregor deleted the parse-diags-build-config branch August 24, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant