Bump version to 19.1.0git
[llvm-project.git] / clang-tools-extra / clangd / test / references.test
blob70e52f4c61535baabf73b54be07fd33f44091711
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":{
5   "uri":"test:///main.cpp",
6   "languageId":"cpp",
7   "version":1,
8   "text":"int x; int y = x;"
9 }}}
10 ---
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/references","params":{
12   "textDocument":{"uri":"test:///main.cpp"},
13   "position":{"line":0,"character":4},
14   "context":{"includeDeclaration": false}
16 #      CHECK:  "id": 1
17 # CHECK-NEXT:  "jsonrpc": "2.0",
18 # CHECK-NEXT:  "result": [
19 # CHECK-NEXT:    {
20 # CHECK-NEXT:      "range": {
21 # CHECK-NEXT:        "end": {
22 # CHECK-NEXT:          "character": 16,
23 # CHECK-NEXT:          "line": 0
24 # CHECK-NEXT:        },
25 # CHECK-NEXT:        "start": {
26 # CHECK-NEXT:          "character": 15,
27 # CHECK-NEXT:          "line": 0
28 # CHECK-NEXT:        }
29 # CHECK-NEXT:      },
30 # CHECK-NEXT:      "uri": "{{.*}}/main.cpp"
31 # CHECK-NEXT:    }
32 # CHECK-NEXT:  ]
33 ---
34 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
35 ---
36 {"jsonrpc":"2.0","method":"exit"}