Bump version to 19.1.0git
[llvm-project.git] / clang-tools-extra / clangd / test / diagnostic-category.test
blob654c2c0b46556d1949c0388956bd639b2a2fd3bf
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"}}
3 ---
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": [
8 # CHECK-NEXT:      {
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
16 # CHECK-NEXT:          },
17 # CHECK-NEXT:          "start": {
18 # CHECK-NEXT:            "character": 17,
19 # CHECK-NEXT:            "line": 0
20 # CHECK-NEXT:          }
21 # CHECK-NEXT:        },
22 # CHECK-NEXT:        "severity": 1,
23 # CHECK-NEXT:        "source": "clang"
24 # CHECK-NEXT:      },
25 # CHECK-NEXT:      {
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
31 # CHECK-NEXT:          },
32 # CHECK-NEXT:          "start": {
33 # CHECK-NEXT:            "character": 7,
34 # CHECK-NEXT:            "line": 0
35 # CHECK-NEXT:          }
36 # CHECK-NEXT:        },
37 # CHECK-NEXT:        "severity": 3
38 # CHECK-NEXT:      }
39 # CHECK-NEXT:    ],
40 # CHECK-NEXT:    "uri": "file://{{.*}}/foo.c",
41 # CHECK-NEXT:    "version": 0
42 # CHECK-NEXT:  }
43 ---
44 {"jsonrpc":"2.0","id":4,"method":"shutdown"}
45 ---
46 {"jsonrpc":"2.0","method":"exit"}