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":{"categorySupport":true}}},"trace":"off"}}
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","text":"struct Point {}; union Point p;"}}}
5 # CHECK: "method": "textDocument/publishDiagnostics",
6 # CHECK-NEXT: "params": {
7 # CHECK-NEXT: "diagnostics": [
9 # CHECK-NEXT: "category": "Semantic Issue",
10 # CHECK-NEXT: "code": "use_with_wrong_tag",
11 # CHECK-NEXT: "message": "Use of 'Point' with tag type that does not match previous declaration (fix available)\n\nfoo.c:1:8: note: previous use is here",
12 # CHECK-NEXT: "range": {
13 # CHECK-NEXT: "end": {
14 # CHECK-NEXT: "character": 22,
15 # CHECK-NEXT: "line": 0
17 # CHECK-NEXT: "start": {
18 # CHECK-NEXT: "character": 17,
19 # CHECK-NEXT: "line": 0
22 # CHECK-NEXT: "severity": 1,
23 # CHECK-NEXT: "source": "clang"
26 # CHECK-NEXT: "message": "Previous use is here\n\nfoo.c:1:18: error: use of 'Point' with tag type that does not match previous declaration",
27 # CHECK-NEXT: "range": {
28 # CHECK-NEXT: "end": {
29 # CHECK-NEXT: "character": 12,
30 # CHECK-NEXT: "line": 0
32 # CHECK-NEXT: "start": {
33 # CHECK-NEXT: "character": 7,
34 # CHECK-NEXT: "line": 0
37 # CHECK-NEXT: "severity": 3
40 # CHECK-NEXT: "uri": "file://{{.*}}/foo.c",
41 # CHECK-NEXT: "version": 0
44 {"jsonrpc":"2.0","id":4,"method":"shutdown"}
46 {"jsonrpc":"2.0","method":"exit"}