Files
swift-mirror/test/IDE/complete_from_foundation_overlay.swift
Argyrios Kyrtzidis 69918a966d [ASTPrinter] Fix printing of nested typealias types and make it consistent with printing of nominal types.
This fixes several issues:
- By default parent types of alias types are not printed which results in
	- Erroneous fixits, for example when casting to 'Notification.Name' from a string, which ends up adding erroneous cast
	  as "Name(rawValue: ...)"
	- Hard to understand types in code-completion results and diagnostics
- When printing with 'fully-qualified' option typealias types are printed erroneously like this "<PARENT>.Type.<TYPEALIAS>"

The change make typealias printing same as nominal types and addresses the above.
2016-08-11 12:15:15 -07:00

33 lines
1.3 KiB
Swift

import Foundation
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PLAIN_TOP_LEVEL_1 > %t.toplevel.txt
// RUN: %FileCheck %s -check-prefix=PLAIN_TOP_LEVEL < %t.toplevel.txt
// RUN: %FileCheck %s -check-prefix=NO_STDLIB_PRIVATE < %t.toplevel.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRIVATE_NOMINAL_MEMBERS_1 > %t.members.txt
// RUN: %FileCheck %s -check-prefix=PRIVATE_NOMINAL_MEMBERS_1 < %t.members.txt
// RUN: %FileCheck %s -check-prefix=NO_STDLIB_PRIVATE < %t.members.txt
// REQUIRES: objc_interop
// NO_STDLIB_PRIVATE: Begin completions
// NO_STDLIB_PRIVATE-NOT: _convertStringToNSString
// NO_STDLIB_PRIVATE: End completions
#^PLAIN_TOP_LEVEL_1^#
// PLAIN_TOP_LEVEL: Begin completions
// PLAIN_TOP_LEVEL-DAG: Decl[Struct]/OtherModule[Foundation.NSURL]: URLResourceKey[#URLResourceKey#]{{; name=.+}}
// PLAIN_TOP_LEVEL: End completions
func privateNominalMembers(a: String) {
a.#^PRIVATE_NOMINAL_MEMBERS_1^#
}
// PRIVATE_NOMINAL_MEMBERS_1: Begin completions
// FIXME: we should show the qualified String.Index type.
// rdar://problem/20788802
// PRIVATE_NOMINAL_MEMBERS_1-DAG: Decl[InstanceVar]/CurrNominal: startIndex[#String.Index#]{{; name=.+$}}
// PRIVATE_NOMINAL_MEMBERS_1: End completions