[clang-tools-extra] Fix a link in ReleaseNotes.rst
[llvm-project.git] / clang-tools-extra / clangd / test / inlayHints.test
blob8f302dd17a5494f246d15b9a2468c04664d1d105
1 # RUN: clangd -lit-test < %s | FileCheck %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{}}
3 ---
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///main.cpp",
6   "languageId":"cpp",
7   "version":1,
8   "text":"int foo(int bar);\nint x = foo(42);\nint y = foo(42);"
9 }}}
10 ---
11 {"jsonrpc":"2.0","id":1,"method":"clangd/inlayHints","params":{
12   "textDocument":{"uri":"test:///main.cpp"},
13   "range":{
14     "start": {"line":1,"character":0},
15     "end": {"line":2,"character":0}
16   }
18 #      CHECK:  "id": 1,
19 # CHECK-NEXT:  "jsonrpc": "2.0",
20 # CHECK-NEXT:  "result": [
21 # CHECK-NEXT:    {
22 # CHECK-NEXT:      "kind": "parameter",
23 # CHECK-NEXT:      "label": "bar: ",
24 # CHECK-NEXT:      "position": {
25 # CHECK-NEXT:        "character": 12,
26 # CHECK-NEXT:        "line": 1
27 # CHECK-NEXT:      },
28 # CHECK-NEXT:      "range": {
29 # CHECK-NEXT:        "end": {
30 # CHECK-NEXT:          "character": 14,
31 # CHECK-NEXT:          "line": 1
32 # CHECK-NEXT:        },
33 # CHECK-NEXT:        "start": {
34 # CHECK-NEXT:          "character": 12,
35 # CHECK-NEXT:          "line": 1
36 # CHECK-NEXT:        }
37 # CHECK-NEXT:      }
38 # CHECK-NEXT:    }
39 # CHECK-NEXT:  ]
40 # CHECK-NEXT:}
41 ---
42 {"jsonrpc":"2.0","id":2,"method":"textDocument/inlayHint","params":{
43   "textDocument":{"uri":"test:///main.cpp"},
44   "range":{
45     "start": {"line":1,"character":0},
46     "end": {"line":2,"character":0}
47   }
49 #      CHECK:  "id": 2,
50 # CHECK-NEXT:  "jsonrpc": "2.0",
51 # CHECK-NEXT:  "result": [
52 # CHECK-NEXT:    {
53 # CHECK-NEXT:      "kind": 2,
54 # CHECK-NEXT:      "label": "bar:",
55 # CHECK-NEXT:      "paddingLeft": false,
56 # CHECK-NEXT:      "paddingRight": true,
57 # CHECK-NEXT:      "position": {
58 # CHECK-NEXT:        "character": 12,
59 # CHECK-NEXT:        "line": 1
60 # CHECK-NEXT:      }
61 # CHECK-NEXT:    }
62 # CHECK-NEXT:  ]
63 # CHECK-NEXT:}
64 ---
65 {"jsonrpc":"2.0","id":100,"method":"shutdown"}
66 ---
67 {"jsonrpc":"2.0","method":"exit"}