1 # RUN: clangd -lit-test < %s | FileCheck %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///simple.cpp","languageId":"cpp","version":1,"text":"int x;"}}}
6 {"jsonrpc":"2.0","id":1,"method":"textDocument/ast","params":{"textDocument":{"uri":"test:///simple.cpp"}}}
8 # CHECK-NEXT: "jsonrpc": "2.0",
9 # CHECK-NEXT: "result": {
10 # CHECK-NEXT: "arcana": "{{TranslationUnitDecl.*}}"
11 # CHECK-NEXT: "children": [
13 # CHECK: "arcana": "VarDecl {{.*}} x 'int'",
14 # CHECK-NEXT: "children": [
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
24 # CHECK-NEXT: "start": {
25 # CHECK-NEXT: "character": 0,
26 # CHECK-NEXT: "line": 0
29 # CHECK-NEXT: "role": "type"
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
39 # CHECK-NEXT: "start": {
40 # CHECK-NEXT: "character": 0,
41 # CHECK-NEXT: "line": 0
44 # CHECK-NEXT: "role": "declaration"
47 # CHECK-NEXT: "kind": "TranslationUnit",
48 # CHECK-NEXT: "role": "declaration"
51 {"jsonrpc":"2.0","id":2,"method":"shutdown"}
53 {"jsonrpc":"2.0","method":"exit"}