Skip to content

[CodeCompletion] Test for 'rawValue' completion in multi file scenario #28740

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion test/IDE/complete_multifile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=POINT_DOT | %FileCheck --check-prefix=POINT_DOT %s
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=LENS_DOT | %FileCheck --check-prefix=LENS_DOT %s
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=MYENUM_DOT | %FileCheck --check-prefix=MYENUM_DOT %s
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=MYENUM_INSTANCE_DOT | %FileCheck --check-prefix=MYENUM_INSTANCE_DOT %s
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=HASWRAPPED_DOT| %FileCheck --check-prefix=HASWRAPPED_DOT %s

// BEGIN Library.swift
Expand Down Expand Up @@ -84,7 +85,15 @@ func testRawRepresentable() {
// MYENUM_DOT-DAG: Decl[InstanceMethod]/Super: hash({#(self): MyEnum#})[#(into: inout Hasher) -> Void#];
// MYENUM_DOT: End completions
}

func testRawRepesentableInstance(value: MyEnum) {
value.#^MYENUM_INSTANCE_DOT^#
// MYENUM_INSTANCE_DOT: Begin completions, 4 items
// MYENUM_INSTANCE_DOT-DAG: Keyword[self]/CurrNominal: self[#MyEnum#];
// MYENUM_INSTANCE_DOT-DAG: Decl[InstanceVar]/CurrNominal: rawValue[#String#];
// MYENUM_INSTANCE_DOT-DAG: Decl[InstanceVar]/Super: hashValue[#Int#];
// MYENUM_INSTANCE_DOT-DAG: Decl[InstanceMethod]/Super: hash({#into: &Hasher#})[#Void#];
// MYENUM_INSTANCE_DOT: End completions
}
func testHasWrappedValue(value: HasWrapped) {
value.#^HASWRAPPED_DOT^#
// HASWRAPPED_DOT: Begin completions, 3 items
Expand Down