[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / clangd / test / type-hierarchy-ext.test
blobddb9a014be0c7224a094ec9365dfc2a79572a2e2
1 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
3 ---
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"struct Parent {};\nstruct Child1 : Parent {};\nstruct Child2 : Child1 {};\nstruct Child3 : Child2 {};\nstruct Child4 : Child3 {};"}}}
5 ---
6 {"jsonrpc":"2.0","id":1,"method":"textDocument/typeHierarchy","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":2,"character":11},"direction":2,"resolve":1}}
7 #      CHECK:  "id": 1
8 # CHECK-NEXT:  "jsonrpc": "2.0",
9 # CHECK-NEXT:  "result": {
10 # CHECK-NEXT:    "children": [
11 # CHECK-NEXT:      {
12 # CHECK-NEXT:        "data": {
13 # CHECK-NEXT:           "symbolID": "A6576FE083F2949A"
14 # CHECK-NEXT:        },
15 # CHECK-NEXT:        "kind": 23,
16 # CHECK-NEXT:        "name": "Child3",
17 # CHECK-NEXT:        "range": {
18 # CHECK-NEXT:          "end": {
19 # CHECK-NEXT:            "character": 13,
20 # CHECK-NEXT:            "line": 3
21 # CHECK-NEXT:          },
22 # CHECK-NEXT:          "start": {
23 # CHECK-NEXT:            "character": 7,
24 # CHECK-NEXT:            "line": 3
25 # CHECK-NEXT:          }
26 # CHECK-NEXT:        },
27 # CHECK-NEXT:        "selectionRange": {
28 # CHECK-NEXT:          "end": {
29 # CHECK-NEXT:            "character": 13,
30 # CHECK-NEXT:            "line": 3
31 # CHECK-NEXT:          },
32 # CHECK-NEXT:          "start": {
33 # CHECK-NEXT:            "character": 7,
34 # CHECK-NEXT:            "line": 3
35 # CHECK-NEXT:          }
36 # CHECK-NEXT:        },
37 # CHECK-NEXT:        "uri": "file://{{.*}}/clangd-test/main.cpp"
38 # CHECK-NEXT:      }
39 # CHECK-NEXT:    ],
40 # CHECK-NEXT:    "data": {
41 # CHECK-NEXT:        "parents": [
42 # CHECK-NEXT:         {
43 # CHECK-NEXT:          "parents": [
44 # CHECK-NEXT:            {
45 # CHECK-NEXT:             "parents": [],
46 # CHECK-NEXT:             "symbolID": "FE546E7B648D69A7"
47 # CHECK-NEXT:            }
48 # CHECK-NEXT:          ],
49 # CHECK-NEXT:          "symbolID": "ECDC0C46D75120F4"
50 # CHECK-NEXT:         }
51 # CHECK-NEXT:        ],
52 # CHECK-NEXT:        "symbolID": "8A991335E4E67D08"
53 # CHECK-NEXT:    },
54 # CHECK-NEXT:    "kind": 23,
55 # CHECK-NEXT:    "name": "Child2",
56 # CHECK-NEXT:    "parents": [
57 # CHECK-NEXT:      {
58 # CHECK-NEXT:        "data": {
59 # CHECK-NEXT:          "parents": [
60 # CHECK-NEXT:            {
61 # CHECK-NEXT:             "parents": [],
62 # CHECK-NEXT:             "symbolID": "FE546E7B648D69A7"
63 # CHECK-NEXT:            }
64 # CHECK-NEXT:          ],
65 # CHECK-NEXT:          "symbolID": "ECDC0C46D75120F4"
66 # CHECK-NEXT:        },
67 # CHECK-NEXT:        "kind": 23,
68 # CHECK-NEXT:        "name": "Child1",
69 # CHECK-NEXT:        "parents": [
70 # CHECK-NEXT:          {
71 # CHECK-NEXT:            "data": {
72 # CHECK-NEXT:             "parents": [],
73 # CHECK-NEXT:             "symbolID": "FE546E7B648D69A7"
74 # CHECK-NEXT:            },
75 # CHECK-NEXT:            "kind": 23,
76 # CHECK-NEXT:            "name": "Parent",
77 # CHECK-NEXT:            "parents": [],
78 # CHECK-NEXT:            "range": {
79 # CHECK-NEXT:              "end": {
80 # CHECK-NEXT:                "character": 16,
81 # CHECK-NEXT:                "line": 0
82 # CHECK-NEXT:              },
83 # CHECK-NEXT:              "start": {
84 # CHECK-NEXT:                "character": 0,
85 # CHECK-NEXT:                "line": 0
86 # CHECK-NEXT:              }
87 # CHECK-NEXT:            },
88 # CHECK-NEXT:            "selectionRange": {
89 # CHECK-NEXT:              "end": {
90 # CHECK-NEXT:                "character": 13,
91 # CHECK-NEXT:                "line": 0
92 # CHECK-NEXT:              },
93 # CHECK-NEXT:              "start": {
94 # CHECK-NEXT:                "character": 7,
95 # CHECK-NEXT:                "line": 0
96 # CHECK-NEXT:              }
97 # CHECK-NEXT:            },
98 # CHECK-NEXT:            "uri": "file://{{.*}}/clangd-test/main.cpp"
99 # CHECK-NEXT:          }
100 # CHECK-NEXT:        ],
101 # CHECK-NEXT:        "range": {
102 # CHECK-NEXT:          "end": {
103 # CHECK-NEXT:            "character": 25,
104 # CHECK-NEXT:            "line": 1
105 # CHECK-NEXT:          },
106 # CHECK-NEXT:          "start": {
107 # CHECK-NEXT:            "character": 0,
108 # CHECK-NEXT:            "line": 1
109 # CHECK-NEXT:          }
110 # CHECK-NEXT:        },
111 # CHECK-NEXT:        "selectionRange": {
112 # CHECK-NEXT:          "end": {
113 # CHECK-NEXT:            "character": 13,
114 # CHECK-NEXT:            "line": 1
115 # CHECK-NEXT:          },
116 # CHECK-NEXT:          "start": {
117 # CHECK-NEXT:            "character": 7,
118 # CHECK-NEXT:            "line": 1
119 # CHECK-NEXT:          }
120 # CHECK-NEXT:        },
121 # CHECK-NEXT:        "uri": "file://{{.*}}/clangd-test/main.cpp"
122 # CHECK-NEXT:      }
123 # CHECK-NEXT:    ],
124 # CHECK-NEXT:    "range": {
125 # CHECK-NEXT:      "end": {
126 # CHECK-NEXT:        "character": 25,
127 # CHECK-NEXT:        "line": 2
128 # CHECK-NEXT:      },
129 # CHECK-NEXT:      "start": {
130 # CHECK-NEXT:        "character": 0,
131 # CHECK-NEXT:        "line": 2
132 # CHECK-NEXT:      }
133 # CHECK-NEXT:    },
134 # CHECK-NEXT:    "selectionRange": {
135 # CHECK-NEXT:      "end": {
136 # CHECK-NEXT:        "character": 13,
137 # CHECK-NEXT:        "line": 2
138 # CHECK-NEXT:      },
139 # CHECK-NEXT:      "start": {
140 # CHECK-NEXT:        "character": 7,
141 # CHECK-NEXT:        "line": 2
142 # CHECK-NEXT:      }
143 # CHECK-NEXT:    },
144 # CHECK-NEXT:    "uri": "file://{{.*}}/clangd-test/main.cpp"
145 # CHECK-NEXT:  }
147 {"jsonrpc":"2.0","id":2,"method":"typeHierarchy/resolve","params":{"item":{"uri":"test:///main.cpp","data":{"symbolID":"A6576FE083F2949A"},"name":"Child3","kind":23,"range":{"end":{"character":13,"line":3},"start":{"character":7,"line":3}},"selectionRange":{"end":{"character":13,"line":3},"start":{"character":7,"line":3}}},"direction":0,"resolve":1}}
148 #      CHECK:  "id": 2
149 # CHECK-NEXT:  "jsonrpc": "2.0",
150 # CHECK-NEXT:  "result": {
151 # CHECK-NEXT:    "children": [
152 # CHECK-NEXT:      {
153 # CHECK-NEXT:        "data": {
154 # CHECK-NEXT:          "symbolID": "5705B382DFC77CBC"
155 # CHECK-NEXT:        },
156 # CHECK-NEXT:        "kind": 23,
157 # CHECK-NEXT:        "name": "Child4",
158 # CHECK-NEXT:        "range": {
159 # CHECK-NEXT:          "end": {
160 # CHECK-NEXT:            "character": 13,
161 # CHECK-NEXT:            "line": 4
162 # CHECK-NEXT:          },
163 # CHECK-NEXT:          "start": {
164 # CHECK-NEXT:            "character": 7,
165 # CHECK-NEXT:            "line": 4
166 # CHECK-NEXT:          }
167 # CHECK-NEXT:        },
168 # CHECK-NEXT:        "selectionRange": {
169 # CHECK-NEXT:          "end": {
170 # CHECK-NEXT:            "character": 13,
171 # CHECK-NEXT:            "line": 4
172 # CHECK-NEXT:          },
173 # CHECK-NEXT:          "start": {
174 # CHECK-NEXT:            "character": 7,
175 # CHECK-NEXT:            "line": 4
176 # CHECK-NEXT:          }
177 # CHECK-NEXT:        },
178 # CHECK-NEXT:        "uri": "file://{{.*}}/clangd-test/main.cpp"
179 # CHECK-NEXT:      }
180 # CHECK-NEXT:    ],
181 # CHECK-NEXT:    "data": {
182 # CHECK-NEXT:      "symbolID": "A6576FE083F2949A"
183 # CHECK-NEXT:    },
184 # CHECK-NEXT:    "kind": 23,
185 # CHECK-NEXT:    "name": "Child3",
186 # CHECK-NEXT:    "range": {
187 # CHECK-NEXT:      "end": {
188 # CHECK-NEXT:        "character": 13,
189 # CHECK-NEXT:        "line": 3
190 # CHECK-NEXT:      },
191 # CHECK-NEXT:      "start": {
192 # CHECK-NEXT:        "character": 7,
193 # CHECK-NEXT:        "line": 3
194 # CHECK-NEXT:      }
195 # CHECK-NEXT:    },
196 # CHECK-NEXT:    "selectionRange": {
197 # CHECK-NEXT:      "end": {
198 # CHECK-NEXT:        "character": 13,
199 # CHECK-NEXT:        "line": 3
200 # CHECK-NEXT:      },
201 # CHECK-NEXT:      "start": {
202 # CHECK-NEXT:        "character": 7,
203 # CHECK-NEXT:        "line": 3
204 # CHECK-NEXT:      }
205 # CHECK-NEXT:    },
206 # CHECK-NEXT:    "uri": "file://{{.*}}/clangd-test/main.cpp"
207 # CHECK-NEXT:  }
209 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
211 {"jsonrpc":"2.0","method":"exit"}