Bump version to 19.1.0git
[llvm-project.git] / clang-tools-extra / clangd / test / fixits-embed-in-diagnostic.test
blob26d3820d043227de3d5fa33c1965d89326a6cbdd
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":{"codeActionsInline":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:        "code": "use_with_wrong_tag",
10 # CHECK-NEXT:        "codeActions": [
11 # CHECK-NEXT:          {
12 # CHECK-NEXT:            "edit": {
13 # CHECK-NEXT:              "changes": {
14 # CHECK-NEXT:                "file://{{.*}}/foo.c": [
15 # CHECK-NEXT:                  {
16 # CHECK-NEXT:                    "newText": "struct",
17 # CHECK-NEXT:                    "range": {
18 # CHECK-NEXT:                      "end": {
19 # CHECK-NEXT:                        "character": 22,
20 # CHECK-NEXT:                        "line": 0
21 # CHECK-NEXT:                      },
22 # CHECK-NEXT:                      "start": {
23 # CHECK-NEXT:                        "character": 17,
24 # CHECK-NEXT:                        "line": 0
25 # CHECK-NEXT:                      }
26 # CHECK-NEXT:                    }
27 # CHECK-NEXT:                  }
28 # CHECK-NEXT:                ]
29 # CHECK-NEXT:              }
30 # CHECK-NEXT:            },
31 # CHECK-NEXT:            "isPreferred": true,
32 # CHECK-NEXT:            "kind": "quickfix",
33 # CHECK-NEXT:            "title": "change 'union' to 'struct'"
34 # CHECK-NEXT:          }
35 # CHECK-NEXT:        ],
36 # 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",
37 # CHECK-NEXT:        "range": {
38 # CHECK-NEXT:          "end": {
39 # CHECK-NEXT:            "character": 22,
40 # CHECK-NEXT:            "line": 0
41 # CHECK-NEXT:          },
42 # CHECK-NEXT:          "start": {
43 # CHECK-NEXT:            "character": 17,
44 # CHECK-NEXT:            "line": 0
45 # CHECK-NEXT:          }
46 # CHECK-NEXT:        },
47 # CHECK-NEXT:        "severity": 1,
48 # CHECK-NEXT:        "source": "clang"
49 # CHECK-NEXT:      },
50 # CHECK-NEXT:      {
51 # CHECK-NEXT:        "codeActions": [],
52 # 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",
53 # CHECK-NEXT:        "range": {
54 # CHECK-NEXT:          "end": {
55 # CHECK-NEXT:            "character": 12,
56 # CHECK-NEXT:            "line": 0
57 # CHECK-NEXT:          },
58 # CHECK-NEXT:          "start": {
59 # CHECK-NEXT:            "character": 7,
60 # CHECK-NEXT:            "line": 0
61 # CHECK-NEXT:          }
62 # CHECK-NEXT:        },
63 # CHECK-NEXT:        "severity": 3
64 # CHECK-NEXT:      }
65 # CHECK-NEXT:    ],
66 # CHECK-NEXT:    "uri": "file://{{.*}}/foo.c",
67 # CHECK-NEXT:    "version": 0
68 # CHECK-NEXT:  }
69 ---
70 {"jsonrpc":"2.0","id":4,"method":"shutdown"}
71 ---
72 {"jsonrpc":"2.0","method":"exit"}