Description
I just learned that swiftc -print-supported-features allows tools to inspect exactly which upcoming/experimental features a version of the toolchain supports, and I think it'd be great to integrate into sourcekit-lsp to get autocompletion and diagnostics for the magic strings one puts in.
For example, here I'd like to see:
// swift-tools-version: 6.4
import PackageDescription
let package = Package(
name: "FeatureTest",
targets: [
.target(
name: "FeatureTest",
swiftSettings: [
.enableUpcomingFeature("InternalImportsByDefault"), // no warning, all good
.enableUpcomingFeature("ExistentialAy"), // <<< warning: 'ExistentialAy' is not a recognized upcoming feature; did you mean 'ExistentialAny'?
.enableUpcomingFeature("Embedded"), // <<< warning: 'Embedded' is not an upcoming feature, use 'enableExperimentalFeature' instead
.enableUpcomingFeature("ConciseMagicFile"), // <<< warning: Upcoming feature 'ConciseMagicFile' already enabled as of the Swift 6 language mode
.enableUpcomingFeature("ExistentialAny"), // no warning, all good
]
)
]
)
An extra reason is that making a typo in these strings silently disables a feature you're expecting to be enabled, and presumably burns some amount of time across the ecosystem. This sort of diagnostics and autocompletion would be a nice quality-of-life improvement.
Description
I just learned that
swiftc -print-supported-featuresallows tools to inspect exactly which upcoming/experimental features a version of the toolchain supports, and I think it'd be great to integrate into sourcekit-lsp to get autocompletion and diagnostics for the magic strings one puts in.For example, here I'd like to see:
An extra reason is that making a typo in these strings silently disables a feature you're expecting to be enabled, and presumably burns some amount of time across the ecosystem. This sort of diagnostics and autocompletion would be a nice quality-of-life improvement.