mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Driver uses its path to derive the plugin paths (i.e. 'lib/swift/host/plugins' et al.) Previously it was a constant string 'swiftc' that caused SourceKit failed to find dylib plugins in the toolchain. Since 'SwiftLangSupport' knows the swift-frontend path, use it, but replacing the filename with 'swiftc', to derive the plugin paths. rdar://107849796
48 lines
1.2 KiB
Swift
48 lines
1.2 KiB
Swift
|
|
@OptionSet<UInt8>
|
|
struct ShippingOptions {
|
|
private enum Options: Int {
|
|
case nextDay
|
|
case secondDay
|
|
case priority
|
|
case standard
|
|
}
|
|
|
|
static let express: ShippingOptions = [.nextDay, .secondDay]
|
|
static let all: ShippingOptions = [.express, .priority, .standard]
|
|
}
|
|
|
|
func test(opts: ShippingOptions) {
|
|
let _ = ShippingOptions.nextDay
|
|
}
|
|
|
|
// REQUIRES: swift_swift_parser
|
|
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %sourcekitd-test \
|
|
// RUN: -shell -- echo '## DIAGS ##' == \
|
|
// RUN: -req=diags %s -- %s ==\
|
|
// RUN: -shell -- echo '## CURSOR ##' == \
|
|
// RUN: -req=cursor -pos=16:27 %s -- %s == \
|
|
// RUN: -shell -- echo '## COMPLETE ##' == \
|
|
// RUN: -req=complete -pos=16:27 %s -- %s == \
|
|
// RUN: -shell -- echo '## COMPILE ##' == \
|
|
// RUN: -req=compile -name test -- -c %s -module-name TestModule -o %t/out.o \
|
|
// RUN: | %FileCheck %s
|
|
|
|
// CHECK-LABEL: ## DIAGS ##
|
|
// CHECK: key.diagnostics: [
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-LABEL: ## CURSOR ##
|
|
// CHECK: source.lang.swift.ref.var.static
|
|
|
|
// CHECK-LABEL: ## COMPLETE ##
|
|
// CHECK: key.results: [
|
|
// CHECK: key.description: "secondDay"
|
|
|
|
// CHECK-LABEL: ## COMPILE ##
|
|
// CHECK: key.diagnostics: [
|
|
// CHECK-NEXT: ],
|
|
// CHECK: key.value: 0
|