1 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{"textDocument":{"publishDiagnostics":{"relatedInformation":true}}},"trace":"off"}}
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.cc","languageId":"cpp","text":"int x;\nint x;"}}}
5 # CHECK: "method": "textDocument/publishDiagnostics",
6 # CHECK-NEXT: "params": {
7 # CHECK-NEXT: "diagnostics": [
9 # CHECK-NEXT: "code": "redefinition",
10 # CHECK-NEXT: "message": "Redefinition of 'x'",
11 # CHECK-NEXT: "range": {
12 # CHECK-NEXT: "end": {
13 # CHECK-NEXT: "character": 5,
14 # CHECK-NEXT: "line": 1
16 # CHECK-NEXT: "start": {
17 # CHECK-NEXT: "character": 4,
18 # CHECK-NEXT: "line": 1
21 # CHECK-NEXT: "relatedInformation": [
23 # CHECK-NEXT: "location": {
24 # CHECK-NEXT: "range": {
25 # CHECK-NEXT: "end": {
26 # CHECK-NEXT: "character": 5,
27 # CHECK-NEXT: "line": 0
29 # CHECK-NEXT: "start": {
30 # CHECK-NEXT: "character": 4,
31 # CHECK-NEXT: "line": 0
34 # CHECK-NEXT: "uri": "{{.*}}foo.cc"
36 # CHECK-NEXT: "message": "Previous definition is here"
39 # CHECK-NEXT: "severity": 1,
40 # CHECK-NEXT: "source": "clang"
43 # CHECK-NEXT: "uri": "file://{{.*}}/foo.cc",
44 # CHECK-NEXT: "version": 0
47 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
49 {"jsonrpc":"2.0","method":"exit"}