Files
swift-mirror/test/IDE/complete_override_extension.swift
Rintaro Ishizaki ab7ba4ce79 [CodeCompletion] Don't show protocol extension only members in override
Protocol extension only members are not customization point. Code
completion should not suggest them in override/conformance completion.

rdar://problem/53591636
2020-04-27 11:52:27 -07:00

39 lines
1.3 KiB
Swift

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token CONFORMANCE_EXT | %FileCheck %s --check-prefix=CONFORMANCE_EXT
protocol P {
init(requirement: Int)
init(customizable: Int)
var requirementVar: Int { get }
var customizableVar: Int { get }
func requirementMethod()
func customizableMethod()
}
extension P {
init(customizable v: Int) { self.init(requirement: v) }
init(nonRequirement v: Int) { self.init(requirement: v) }
var customizableVar: Int { 1 }
var nonRequirementVar: Int { 1 }
func customizableMethod() {}
func nonRequirement() {}
}
struct S: P {
#^CONFORMANCE_EXT^#
// CONFORMANCE_EXT: Begin completions
// CONFORMANCE_EXT-NOT: nonRequirement
// CONFORMANCE_EXT-DAG: Decl[Constructor]/Super: init(requirement: Int) {|};
// CONFORMANCE_EXT-DAG: Decl[Constructor]/Super: init(customizable: Int) {|};
// CONFORMANCE_EXT-DAG: Decl[InstanceVar]/Super: var requirementVar: Int;
// CONFORMANCE_EXT-DAG: Decl[InstanceVar]/Super: var customizableVar: Int;
// CONFORMANCE_EXT-DAG: Decl[InstanceMethod]/Super: func requirementMethod() {|};
// CONFORMANCE_EXT-DAG: Decl[InstanceMethod]/Super: func customizableMethod() {|};
// CONFORMANCE_EXT-NOT: nonRequirement
// CONFORMANCE_EXT: End completions
}