mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Adds a new 'key.retrieve_symbol_graph' option to the request. When set to 1 it includes the JSON for a SymbolGraph containing a single node for the symbol at the requested position. This also extends the SymbolGraph library with a new entry point to get a graph for a single symbol, and to additionally support type substitution to match the existing CursorInfo behavior (e.g. so that when invoked on `first` in `Array<Int>().first`, the type is given as `Int?` rather than `Element?`). Resolves rdar://problem/70551509
24 lines
833 B
Swift
24 lines
833 B
Swift
protocol Proto {}
|
|
struct ConcreteProto : Proto {}
|
|
struct ConcreteProtoGen<T> : Proto {}
|
|
|
|
struct S<T> : Proto {
|
|
func methodForProto1(x: T) -> ConcreteProto {}
|
|
func methodForProto2<U>(x: U) -> ConcreteProtoGen<U> {}
|
|
func methodForProto3(x: Self) -> ConcreteProtoGen<T> {}
|
|
func methodForProto4() -> Self {}
|
|
func methodForInt() -> Int { return 1 }
|
|
mutating func test() {
|
|
self.
|
|
}
|
|
}
|
|
|
|
func test<X>(value: S<X>) {
|
|
value.
|
|
}
|
|
|
|
// RUN: %sourcekitd-test -req=conformingmethods -pos=12:10 %s -req-opts=expectedtypes='[$s8MyModule5ProtoPD]' -- -module-name MyModule %s > %t.response.1
|
|
// RUN: %diff -u %s.response.1 %t.response.1
|
|
// RUN: %sourcekitd-test -req=conformingmethods -pos=17:8 %s -req-opts=expectedtypes='[$s8MyModule5ProtoPD]' -- -module-name MyModule %s > %t.response.2
|
|
// RUN: %diff -u %s.response.2 %t.response.2
|