1 # RUN: clangd -lit-test -clang-tidy=false < %s | FileCheck -strict-whitespace %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:///foo.c","languageId":"c","text":"void main() {\n(void)sizeof(42);\n}"}}}
5 # CHECK: "method": "textDocument/publishDiagnostics",
6 # CHECK-NEXT: "params": {
7 # CHECK-NEXT: "diagnostics": [
9 # CHECK-NEXT: "code": "-Wmain-return-type",
10 # CHECK-NEXT: "message": "Return type of 'main' is not 'int' (fix available)",
11 # CHECK-NEXT: "range": {
12 # CHECK-NEXT: "end": {
13 # CHECK-NEXT: "character": 4,
14 # CHECK-NEXT: "line": 0
16 # CHECK-NEXT: "start": {
17 # CHECK-NEXT: "character": 0,
18 # CHECK-NEXT: "line": 0
21 # CHECK-NEXT: "severity": 2,
22 # CHECK-NEXT: "source": "clang"
25 # CHECK-NEXT: "uri": "file://{{.*}}/foo.c",
26 # CHECK-NEXT: "version": 0
29 {"jsonrpc":"2.0","id":2,"method":"sync","params":null}
31 {"jsonrpc":"2.0","method":"textDocument/didClose","params":{"textDocument":{"uri":"test:///foo.c"}}}
32 # CHECK: "method": "textDocument/publishDiagnostics",
33 # CHECK-NEXT: "params": {
34 # CHECK-NEXT: "diagnostics": [],
35 # CHECK-NEXT: "uri": "file://{{.*}}/foo.c"
38 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
40 {"jsonrpc":"2.0","method":"exit"}