Bump version to 19.1.0git
[llvm-project.git] / clang-tools-extra / clangd / test / inlayHints.test
blobe5b3c0fb0b960aa13a1acefb184e9795ff4854c8
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": [
55 # CHECK-NEXT:        {
56 # CHECK-NEXT:          "value": "bar:"
57 # CHECK-NEXT:        }
58 # CHECK-NEXT:      ],
59 # CHECK-NEXT:      "paddingLeft": false,
60 # CHECK-NEXT:      "paddingRight": true,
61 # CHECK-NEXT:      "position": {
62 # CHECK-NEXT:        "character": 12,
63 # CHECK-NEXT:        "line": 1
64 # CHECK-NEXT:      }
65 # CHECK-NEXT:    }
66 # CHECK-NEXT:  ]
67 # CHECK-NEXT:}
68 ---
69 {"jsonrpc":"2.0","id":100,"method":"shutdown"}
70 ---
71 {"jsonrpc":"2.0","method":"exit"}