Bump version to 19.1.0git
[llvm-project.git] / clang-tools-extra / clangd / test / ast.test
blob2185f14eefb8b902ddb20280c5d8b8f0af4ad2e7
1 # RUN: clangd -lit-test < %s | FileCheck %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":{"uri":"test:///simple.cpp","languageId":"cpp","version":1,"text":"int x;"}}}
5 ---
6 {"jsonrpc":"2.0","id":1,"method":"textDocument/ast","params":{
7   "textDocument":{"uri":"test:///simple.cpp"},
8   "range": {"start": {"line":0, "character":0}, "end": {"line":0, "character":5}}
9 }}
10 #      CHECK:  "id": 1,
11 # CHECK-NEXT:  "jsonrpc": "2.0",
12 # CHECK-NEXT:  "result": {
13 # CHECK-NEXT:    "arcana": "VarDecl {{.*}} x 'int'",
14 # CHECK-NEXT:    "children": [
15 # CHECK-NEXT:      {
16 # CHECK-NEXT:        "arcana": "QualType {{.*}} 'int' ",
17 # CHECK-NEXT:        "detail": "int",
18 # CHECK-NEXT:        "kind": "Builtin",
19 # CHECK-NEXT:        "range": {
20 # CHECK-NEXT:          "end": {
21 # CHECK-NEXT:            "character": 3,
22 # CHECK-NEXT:            "line": 0
23 # CHECK-NEXT:          },
24 # CHECK-NEXT:          "start": {
25 # CHECK-NEXT:            "character": 0,
26 # CHECK-NEXT:            "line": 0
27 # CHECK-NEXT:          }
28 # CHECK-NEXT:        },
29 # CHECK-NEXT:        "role": "type"
30 # CHECK-NEXT:      }
31 # CHECK-NEXT:    ],
32 # CHECK-NEXT:    "detail": "x",
33 # CHECK-NEXT:    "kind": "Var",
34 # CHECK-NEXT:    "range": {
35 # CHECK-NEXT:      "end": {
36 # CHECK-NEXT:        "character": 5,
37 # CHECK-NEXT:        "line": 0
38 # CHECK-NEXT:      },
39 # CHECK-NEXT:      "start": {
40 # CHECK-NEXT:        "character": 0,
41 # CHECK-NEXT:        "line": 0
42 # CHECK-NEXT:      }
43 # CHECK-NEXT:    },
44 # CHECK-NEXT:    "role": "declaration"
45 # CHECK-NEXT:  }
46 ---
47 {"jsonrpc":"2.0","id":2,"method":"shutdown"}
48 ---
49 {"jsonrpc":"2.0","method":"exit"}