|
| 1 | +// Test is line- and column-sensitive. Run lines are below |
| 2 | + |
| 3 | +template <typename T> |
| 4 | +class basic_vector { |
| 5 | +public: |
| 6 | + T x; |
| 7 | + T y; |
| 8 | +}; |
| 9 | + |
| 10 | +using my_vec = basic_vector<int>; |
| 11 | + |
| 12 | +class MyClass { |
| 13 | + my_vec myVec; |
| 14 | +}; |
| 15 | + |
| 16 | +struct OuterStruct { |
| 17 | + struct InnerStruct; |
| 18 | + int outer_field; |
| 19 | +}; |
| 20 | + |
| 21 | +// RUN: c-index-test -single-symbol-sgf-at=%s:13:7 local %s | FileCheck --check-prefix=CHECK-VEC-TYPE %s |
| 22 | +// CHECK-VEC-TYPE: "parentContexts":[{"kind":"c++.typealias","name":"my_vec","usr":"c:@my_vec"}] |
| 23 | +// CHECK-VEC-TYPE: "declarationFragments":[{"kind":"keyword","spelling":"typedef"},{"kind":"text","spelling":" "},{"kind":"typeIdentifier","preciseIdentifier":"c:@ST>1#T@basic_vector","spelling":"basic_vector"},{"kind":"text","spelling":"<"},{"kind":"typeIdentifier","preciseIdentifier":"c:I","spelling":"int"},{"kind":"text","spelling":"> "},{"kind":"identifier","spelling":"my_vec"},{"kind":"text","spelling":";"}] |
| 24 | +// CHECK-VEC-TYPE: "identifier":{"interfaceLanguage":"c++","precise":"c:@my_vec"} |
| 25 | +// CHECK-VEC-TYPE: "kind":{"displayName":"Type Alias","identifier":"c++.typealias"} |
| 26 | +// CHECK-VEC-TYPE: "title":"my_vec" |
| 27 | +// CHECK-VEC-TYPE: "pathComponents":["my_vec"] |
| 28 | + |
| 29 | +// RUN: c-index-test -single-symbol-sgf-at=%s:13:13 local %s | FileCheck --check-prefix=CHECK-MYVEC %s |
| 30 | +// CHECK-MYVEC: "parentContexts":[{"kind":"c++.class","name":"MyClass","usr":"c:@S@MyClass"},{"kind":"c++.property","name":"myVec","usr":"c:@S@MyClass@FI@myVec"}] |
| 31 | +// CHECK-MYVEC: "identifier":{"interfaceLanguage":"c++","precise":"c:@S@MyClass@FI@myVec"} |
| 32 | +// CHECK-MYVEC: "kind":{"displayName":"Instance Property","identifier":"c++.property"} |
| 33 | +// CHECK-MYVEC: "title":"myVec" |
| 34 | +// CHECK-MYVEC: "pathComponents":["MyClass","myVec"] |
| 35 | + |
| 36 | +// RUN: c-index-test -single-symbol-sgf-at=%s:17:17 local %s | FileCheck --check-prefix=CHECK-INNER %s |
| 37 | +// CHECK-INNER: "parentContexts":[{"kind":"c++.struct","name":"OuterStruct","usr":"c:@S@OuterStruct"},{"kind":"c++.struct","name":"InnerStruct","usr":"c:@S@OuterStruct@S@InnerStruct"}] |
| 38 | +// CHECK-INNER: "identifier":{"interfaceLanguage":"c++","precise":"c:@S@OuterStruct@S@InnerStruct"} |
| 39 | +// CHECK-INNER: "kind":{"displayName":"Structure","identifier":"c++.struct"} |
| 40 | +// CHECK-INNER: "title":"InnerStruct" |
| 41 | +// CHECK-INNER: "pathComponents":["OuterStruct","InnerStruct"] |
0 commit comments