[clang-tools-extra] Fix a link in ReleaseNotes.rst
[llvm-project.git] / clang-tools-extra / clangd / test / call-hierarchy.test
blob6548ea0068a8d051c8569955231cba62e1f6e879
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":{"languageId":"cpp","text":"void callee(int);\nvoid caller1() {\n  callee(42);\n}\nvoid caller2() {\n  caller1();\n  caller1();\n}\nvoid caller3() {\n  caller1();\n  caller2();\n}\n","uri":"test:///main.cpp","version":1}}}
5 ---
6 {"jsonrpc":"2.0","id":1,"method":"textDocument/prepareCallHierarchy","params":{"position":{"character":8,"line":0},"textDocument":{"uri":"test:///main.cpp"}}}
7 #      CHECK:  "id": 1,
8 # CHECK-NEXT:  "jsonrpc": "2.0",
9 # CHECK-NEXT:  "result": [
10 # CHECK-NEXT:    {
11 # CHECK-NEXT:      "data": "{{.*}}",
12 # CHECK-NEXT:      "kind": 12,
13 # CHECK-NEXT:      "name": "callee",
14 # CHECK-NEXT:      "range": {
15 # CHECK-NEXT:        "end": {
16 # CHECK-NEXT:          "character": 16,
17 # CHECK-NEXT:          "line": 0
18 # CHECK-NEXT:        },
19 # CHECK-NEXT:        "start": {
20 # CHECK-NEXT:          "character": 0,
21 # CHECK-NEXT:          "line": 0
22 # CHECK-NEXT:        }
23 # CHECK-NEXT:      },
24 # CHECK-NEXT:      "selectionRange": {
25 # CHECK-NEXT:        "end": {
26 # CHECK-NEXT:          "character": 11,
27 # CHECK-NEXT:          "line": 0
28 # CHECK-NEXT:        },
29 # CHECK-NEXT:        "start": {
30 # CHECK-NEXT:          "character": 5,
31 # CHECK-NEXT:          "line": 0
32 # CHECK-NEXT:        }
33 # CHECK-NEXT:      },
34 # CHECK-NEXT:      "uri": "file://{{.*}}/clangd-test/main.cpp"
35 # CHECK-NEXT:    }
36 ---
37 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
38 ---
39 {"jsonrpc":"2.0","method":"exit"}