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"}}
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 {};"}}}
6 {"jsonrpc":"2.0","id":1,"method":"textDocument/prepareTypeHierarchy","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":2,"character":11},"direction":2,"resolve":1}}
8 # CHECK-NEXT: "jsonrpc": "2.0",
9 # CHECK-NEXT: "result": [
11 # CHECK-NEXT: "data": {
12 # CHECK-NEXT: "parents": [
14 # CHECK-NEXT: "parents": [
16 # CHECK-NEXT: "parents": [],
17 # CHECK-NEXT: "symbolID": "FE546E7B648D69A7"
20 # CHECK-NEXT: "symbolID": "ECDC0C46D75120F4"
23 # CHECK-NEXT: "symbolID": "8A991335E4E67D08"
25 # CHECK-NEXT: "kind": 23,
26 # CHECK-NEXT: "name": "Child2",
27 # CHECK-NEXT: "range": {
28 # CHECK-NEXT: "end": {
29 # CHECK-NEXT: "character": 25,
30 # CHECK-NEXT: "line": 2
32 # CHECK-NEXT: "start": {
33 # CHECK-NEXT: "character": 0,
34 # CHECK-NEXT: "line": 2
37 # CHECK-NEXT: "selectionRange": {
38 # CHECK-NEXT: "end": {
39 # CHECK-NEXT: "character": 13,
40 # CHECK-NEXT: "line": 2
42 # CHECK-NEXT: "start": {
43 # CHECK-NEXT: "character": 7,
44 # CHECK-NEXT: "line": 2
47 # CHECK-NEXT: "uri": "file://{{.*}}/clangd-test/main.cpp"
51 {"jsonrpc":"2.0","id":2,"method":"typeHierarchy/supertypes","params":{"item":{"uri":"test:///main.cpp","data":{"parents":[{"parents":[{"parents":[],"symbolID":"FE546E7B648D69A7"}],"symbolID":"ECDC0C46D75120F4"}],"symbolID":"8A991335E4E67D08"},"name":"Child2","kind":23,"range":{"end":{"character":13,"line":3},"start":{"character":7,"line":3}},"selectionRange":{"end":{"character":13,"line":3},"start":{"character":7,"line":3}}}}}
53 # CHECK-NEXT: "jsonrpc": "2.0",
54 # CHECK-NEXT: "result": [
56 # CHECK-NEXT: "data": {
57 # CHECK-NEXT: "parents": [
59 # CHECK-NEXT: "parents": [],
60 # CHECK-NEXT: "symbolID": "FE546E7B648D69A7"
63 # CHECK-NEXT: "symbolID": "ECDC0C46D75120F4"
65 # CHECK-NEXT: "kind": 23,
66 # CHECK-NEXT: "name": "Child1",
67 # CHECK-NEXT: "range": {
68 # CHECK-NEXT: "end": {
69 # CHECK-NEXT: "character": 13,
70 # CHECK-NEXT: "line": 1
72 # CHECK-NEXT: "start": {
73 # CHECK-NEXT: "character": 7,
74 # CHECK-NEXT: "line": 1
77 # CHECK-NEXT: "selectionRange": {
78 # CHECK-NEXT: "end": {
79 # CHECK-NEXT: "character": 13,
80 # CHECK-NEXT: "line": 1
82 # CHECK-NEXT: "start": {
83 # CHECK-NEXT: "character": 7,
84 # CHECK-NEXT: "line": 1
87 # CHECK-NEXT: "uri": "file://{{.*}}/clangd-test/main.cpp"
91 {"jsonrpc":"2.0","id":2,"method":"typeHierarchy/subtypes","params":{"item":{"uri":"test:///main.cpp","data":{"parents":[{"parents":[{"parents":[],"symbolID":"FE546E7B648D69A7"}],"symbolID":"ECDC0C46D75120F4"}],"symbolID":"8A991335E4E67D08"},"name":"Child2","kind":23,"range":{"end":{"character":13,"line":3},"start":{"character":7,"line":3}},"selectionRange":{"end":{"character":13,"line":3},"start":{"character":7,"line":3}}}}}
93 # CHECK-NEXT: "jsonrpc": "2.0",
94 # CHECK-NEXT: "result": [
96 # CHECK-NEXT: "data": {
97 # CHECK-NEXT: "parents": [
99 # CHECK-NEXT: "parents": [
101 # CHECK-NEXT: "parents": [
103 # CHECK-NEXT: "parents": [],
104 # CHECK-NEXT: "symbolID": "FE546E7B648D69A7"
107 # CHECK-NEXT: "symbolID": "ECDC0C46D75120F4"
110 # CHECK-NEXT: "symbolID": "8A991335E4E67D08"
113 # CHECK-NEXT: "symbolID": "A6576FE083F2949A"
115 # CHECK-NEXT: "kind": 23,
116 # CHECK-NEXT: "name": "Child3",
117 # CHECK-NEXT: "range": {
118 # CHECK-NEXT: "end": {
119 # CHECK-NEXT: "character": 13,
120 # CHECK-NEXT: "line": 3
122 # CHECK-NEXT: "start": {
123 # CHECK-NEXT: "character": 7,
124 # CHECK-NEXT: "line": 3
127 # CHECK-NEXT: "selectionRange": {
128 # CHECK-NEXT: "end": {
129 # CHECK-NEXT: "character": 13,
130 # CHECK-NEXT: "line": 3
132 # CHECK-NEXT: "start": {
133 # CHECK-NEXT: "character": 7,
134 # CHECK-NEXT: "line": 3
137 # CHECK-NEXT: "uri": "file://{{.*}}/clangd-test/main.cpp"
141 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
143 {"jsonrpc":"2.0","method":"exit"}