[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang-tools-extra / clangd / test / type-hierarchy-ext.test
blob8d1a5dc31da0f10aa0c473741d58f25c147e25ed
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:        "detail": "Child3",
16 # CHECK-NEXT:        "kind": 23,
17 # CHECK-NEXT:        "name": "Child3",
18 # CHECK-NEXT:        "range": {
19 # CHECK-NEXT:          "end": {
20 # CHECK-NEXT:            "character": 13,
21 # CHECK-NEXT:            "line": 3
22 # CHECK-NEXT:          },
23 # CHECK-NEXT:          "start": {
24 # CHECK-NEXT:            "character": 7,
25 # CHECK-NEXT:            "line": 3
26 # CHECK-NEXT:          }
27 # CHECK-NEXT:        },
28 # CHECK-NEXT:        "selectionRange": {
29 # CHECK-NEXT:          "end": {
30 # CHECK-NEXT:            "character": 13,
31 # CHECK-NEXT:            "line": 3
32 # CHECK-NEXT:          },
33 # CHECK-NEXT:          "start": {
34 # CHECK-NEXT:            "character": 7,
35 # CHECK-NEXT:            "line": 3
36 # CHECK-NEXT:          }
37 # CHECK-NEXT:        },
38 # CHECK-NEXT:        "uri": "file://{{.*}}/clangd-test/main.cpp"
39 # CHECK-NEXT:      }
40 # CHECK-NEXT:    ],
41 # CHECK-NEXT:    "data": {
42 # CHECK-NEXT:        "parents": [
43 # CHECK-NEXT:         {
44 # CHECK-NEXT:          "parents": [
45 # CHECK-NEXT:            {
46 # CHECK-NEXT:             "parents": [],
47 # CHECK-NEXT:             "symbolID": "FE546E7B648D69A7"
48 # CHECK-NEXT:            }
49 # CHECK-NEXT:          ],
50 # CHECK-NEXT:          "symbolID": "ECDC0C46D75120F4"
51 # CHECK-NEXT:         }
52 # CHECK-NEXT:        ],
53 # CHECK-NEXT:        "symbolID": "8A991335E4E67D08"
54 # CHECK-NEXT:    },
55 # CHECK-NEXT:    "kind": 23,
56 # CHECK-NEXT:    "name": "Child2",
57 # CHECK-NEXT:    "parents": [
58 # CHECK-NEXT:      {
59 # CHECK-NEXT:        "data": {
60 # CHECK-NEXT:          "parents": [
61 # CHECK-NEXT:            {
62 # CHECK-NEXT:             "parents": [],
63 # CHECK-NEXT:             "symbolID": "FE546E7B648D69A7"
64 # CHECK-NEXT:            }
65 # CHECK-NEXT:          ],
66 # CHECK-NEXT:          "symbolID": "ECDC0C46D75120F4"
67 # CHECK-NEXT:        },
68 # CHECK-NEXT:        "kind": 23,
69 # CHECK-NEXT:        "name": "Child1",
70 # CHECK-NEXT:        "parents": [
71 # CHECK-NEXT:          {
72 # CHECK-NEXT:            "data": {
73 # CHECK-NEXT:             "parents": [],
74 # CHECK-NEXT:             "symbolID": "FE546E7B648D69A7"
75 # CHECK-NEXT:            },
76 # CHECK-NEXT:            "kind": 23,
77 # CHECK-NEXT:            "name": "Parent",
78 # CHECK-NEXT:            "parents": [],
79 # CHECK-NEXT:            "range": {
80 # CHECK-NEXT:              "end": {
81 # CHECK-NEXT:                "character": 16,
82 # CHECK-NEXT:                "line": 0
83 # CHECK-NEXT:              },
84 # CHECK-NEXT:              "start": {
85 # CHECK-NEXT:                "character": 0,
86 # CHECK-NEXT:                "line": 0
87 # CHECK-NEXT:              }
88 # CHECK-NEXT:            },
89 # CHECK-NEXT:            "selectionRange": {
90 # CHECK-NEXT:              "end": {
91 # CHECK-NEXT:                "character": 13,
92 # CHECK-NEXT:                "line": 0
93 # CHECK-NEXT:              },
94 # CHECK-NEXT:              "start": {
95 # CHECK-NEXT:                "character": 7,
96 # CHECK-NEXT:                "line": 0
97 # CHECK-NEXT:              }
98 # CHECK-NEXT:            },
99 # CHECK-NEXT:            "uri": "file://{{.*}}/clangd-test/main.cpp"
100 # CHECK-NEXT:          }
101 # CHECK-NEXT:        ],
102 # CHECK-NEXT:        "range": {
103 # CHECK-NEXT:          "end": {
104 # CHECK-NEXT:            "character": 25,
105 # CHECK-NEXT:            "line": 1
106 # CHECK-NEXT:          },
107 # CHECK-NEXT:          "start": {
108 # CHECK-NEXT:            "character": 0,
109 # CHECK-NEXT:            "line": 1
110 # CHECK-NEXT:          }
111 # CHECK-NEXT:        },
112 # CHECK-NEXT:        "selectionRange": {
113 # CHECK-NEXT:          "end": {
114 # CHECK-NEXT:            "character": 13,
115 # CHECK-NEXT:            "line": 1
116 # CHECK-NEXT:          },
117 # CHECK-NEXT:          "start": {
118 # CHECK-NEXT:            "character": 7,
119 # CHECK-NEXT:            "line": 1
120 # CHECK-NEXT:          }
121 # CHECK-NEXT:        },
122 # CHECK-NEXT:        "uri": "file://{{.*}}/clangd-test/main.cpp"
123 # CHECK-NEXT:      }
124 # CHECK-NEXT:    ],
125 # CHECK-NEXT:    "range": {
126 # CHECK-NEXT:      "end": {
127 # CHECK-NEXT:        "character": 25,
128 # CHECK-NEXT:        "line": 2
129 # CHECK-NEXT:      },
130 # CHECK-NEXT:      "start": {
131 # CHECK-NEXT:        "character": 0,
132 # CHECK-NEXT:        "line": 2
133 # CHECK-NEXT:      }
134 # CHECK-NEXT:    },
135 # CHECK-NEXT:    "selectionRange": {
136 # CHECK-NEXT:      "end": {
137 # CHECK-NEXT:        "character": 13,
138 # CHECK-NEXT:        "line": 2
139 # CHECK-NEXT:      },
140 # CHECK-NEXT:      "start": {
141 # CHECK-NEXT:        "character": 7,
142 # CHECK-NEXT:        "line": 2
143 # CHECK-NEXT:      }
144 # CHECK-NEXT:    },
145 # CHECK-NEXT:    "uri": "file://{{.*}}/clangd-test/main.cpp"
146 # CHECK-NEXT:  }
148 {"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}}
149 #      CHECK:  "id": 2
150 # CHECK-NEXT:  "jsonrpc": "2.0",
151 # CHECK-NEXT:  "result": {
152 # CHECK-NEXT:    "children": [
153 # CHECK-NEXT:      {
154 # CHECK-NEXT:        "data": {
155 # CHECK-NEXT:          "symbolID": "5705B382DFC77CBC"
156 # CHECK-NEXT:        },
157 # CHECK-NEXT:        "detail": "Child4",
158 # CHECK-NEXT:        "kind": 23,
159 # CHECK-NEXT:        "name": "Child4",
160 # CHECK-NEXT:        "range": {
161 # CHECK-NEXT:          "end": {
162 # CHECK-NEXT:            "character": 13,
163 # CHECK-NEXT:            "line": 4
164 # CHECK-NEXT:          },
165 # CHECK-NEXT:          "start": {
166 # CHECK-NEXT:            "character": 7,
167 # CHECK-NEXT:            "line": 4
168 # CHECK-NEXT:          }
169 # CHECK-NEXT:        },
170 # CHECK-NEXT:        "selectionRange": {
171 # CHECK-NEXT:          "end": {
172 # CHECK-NEXT:            "character": 13,
173 # CHECK-NEXT:            "line": 4
174 # CHECK-NEXT:          },
175 # CHECK-NEXT:          "start": {
176 # CHECK-NEXT:            "character": 7,
177 # CHECK-NEXT:            "line": 4
178 # CHECK-NEXT:          }
179 # CHECK-NEXT:        },
180 # CHECK-NEXT:        "uri": "file://{{.*}}/clangd-test/main.cpp"
181 # CHECK-NEXT:      }
182 # CHECK-NEXT:    ],
183 # CHECK-NEXT:    "data": {
184 # CHECK-NEXT:      "symbolID": "A6576FE083F2949A"
185 # CHECK-NEXT:    },
186 # CHECK-NEXT:    "kind": 23,
187 # CHECK-NEXT:    "name": "Child3",
188 # CHECK-NEXT:    "range": {
189 # CHECK-NEXT:      "end": {
190 # CHECK-NEXT:        "character": 13,
191 # CHECK-NEXT:        "line": 3
192 # CHECK-NEXT:      },
193 # CHECK-NEXT:      "start": {
194 # CHECK-NEXT:        "character": 7,
195 # CHECK-NEXT:        "line": 3
196 # CHECK-NEXT:      }
197 # CHECK-NEXT:    },
198 # CHECK-NEXT:    "selectionRange": {
199 # CHECK-NEXT:      "end": {
200 # CHECK-NEXT:        "character": 13,
201 # CHECK-NEXT:        "line": 3
202 # CHECK-NEXT:      },
203 # CHECK-NEXT:      "start": {
204 # CHECK-NEXT:        "character": 7,
205 # CHECK-NEXT:        "line": 3
206 # CHECK-NEXT:      }
207 # CHECK-NEXT:    },
208 # CHECK-NEXT:    "uri": "file://{{.*}}/clangd-test/main.cpp"
209 # CHECK-NEXT:  }
211 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
213 {"jsonrpc":"2.0","method":"exit"}