[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / clangd / test / include-cleaner-batch-fix.test
blobaf7cdba5b05f431a365f319d859c53eeb37a9831
1 # We specify a custom path in XDG_CONFIG_HOME, which only works on some systems.
2 # UNSUPPORTED: system-windows
3 # UNSUPPORTED: system-darwin
5 # RUN: rm -rf %t
6 # RUN: mkdir -p %t/clangd
7 # RUN: cp -r %S/Inputs/include-cleaner %t/include
8 # RUN: echo '-I%t/include' > %t/compile_flags.txt
9 # Create a config file enabling include-cleaner features.
10 # RUN: echo $'Diagnostics:\n  UnusedIncludes: Strict\n  MissingIncludes: Strict' >> %t/clangd/config.yaml
12 # RUN: env XDG_CONFIG_HOME=%t clangd -lit-test -enable-config --compile-commands-dir=%t < %s | FileCheck -strict-whitespace %s
13 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{"workspace":{"workspaceEdit":{"documentChanges":true, "changeAnnotationSupport":{"groupsOnLabel":true}}}},"trace":"off"}}
14 ---
16   "jsonrpc": "2.0",
17   "method": "textDocument/didOpen",
18   "params": {
19     "textDocument": {
20       "uri": "test:///simple.cpp",
21       "languageId": "cpp",
22       "text": "#include \"all1.h\"\n#include \"all2.h\"\n Foo* foo; Bar* bar;"
23     }
24   }
26 # First, the diagnostic from the config file.
27 #      CHECK:  "method": "textDocument/publishDiagnostics",
28 # CHECK-NEXT:  "params": {
29 # CHECK-NEXT:    "diagnostics": [],
31 # Then, diagnostic from the main cpp file.
32 #      CHECK:  "method": "textDocument/publishDiagnostics",
33 # CHECK-NEXT:  "params": {
34 # CHECK-NEXT:     "diagnostics": [
35 # CHECK-NEXT:       {
36 # CHECK-NEXT:         "code": "missing-includes",
37 # CHECK-NEXT:         "codeDescription": {
38 # CHECK-NEXT:           "href": "{{.*}}"
39 # CHECK-NEXT:         },
40 # CHECK-NEXT:         "message": "No header providing \"Foo\" is directly included (fixes available)",
41 # CHECK-NEXT:         "range": {
42 # CHECK-NEXT:           "end": {
43 # CHECK-NEXT:             "character": 4,
44 # CHECK-NEXT:             "line": 2
45 # CHECK-NEXT:           },
46 # CHECK-NEXT:           "start": {
47 # CHECK-NEXT:             "character": 1,
48 # CHECK-NEXT:             "line": 2
49 # CHECK-NEXT:           }
50 # CHECK-NEXT:         },
51 # CHECK-NEXT:         "severity": 3,
52 # CHECK-NEXT:         "source": "clangd"
53 # CHECK-NEXT:       },
54 # CHECK-NEXT:       {
55 # CHECK-NEXT:         "code": "missing-includes",
56 # CHECK-NEXT:         "codeDescription": {
57 # CHECK-NEXT:           "href": "{{.*}}"
58 # CHECK-NEXT:         },
59 # CHECK-NEXT:         "message": "No header providing \"Bar\" is directly included (fixes available)",
60 # CHECK-NEXT:         "range": {
61 # CHECK-NEXT:           "end": {
62 # CHECK-NEXT:             "character": 14,
63 # CHECK-NEXT:             "line": 2
64 # CHECK-NEXT:           },
65 # CHECK-NEXT:           "start": {
66 # CHECK-NEXT:             "character": 11,
67 # CHECK-NEXT:             "line": 2
68 # CHECK-NEXT:           }
69 # CHECK-NEXT:         },
70 # CHECK-NEXT:         "severity": 3,
71 # CHECK-NEXT:         "source": "clangd"
72 # CHECK-NEXT:       },
73 # CHECK-NEXT:       {
74 # CHECK-NEXT:         "code": "unused-includes",
75 # CHECK-NEXT:         "codeDescription": {
76 # CHECK-NEXT:           "href": "{{.*}}"
77 # CHECK-NEXT:         },
78 # CHECK-NEXT:         "message": "Included header all1.h is not used directly (fixes available)",
79 # CHECK-NEXT:         "range": {
80 # CHECK-NEXT:           "end": {
81 # CHECK-NEXT:             "character": 17,
82 # CHECK-NEXT:             "line": 0
83 # CHECK-NEXT:           },
84 # CHECK-NEXT:           "start": {
85 # CHECK-NEXT:             "character": 0,
86 # CHECK-NEXT:             "line": 0
87 # CHECK-NEXT:           }
88 # CHECK-NEXT:         },
89 # CHECK-NEXT:         "severity": 2,
90 # CHECK-NEXT:         "source": "clangd",
91 # CHECK-NEXT:         "tags": [
92 # CHECK-NEXT:           1
93 # CHECK-NEXT:         ]
94 # CHECK-NEXT:       },
95 # CHECK-NEXT:       {
96 # CHECK-NEXT:         "code": "unused-includes",
97 # CHECK-NEXT:         "codeDescription": {
98 # CHECK-NEXT:           "href": "{{.*}}"
99 # CHECK-NEXT:         },
100 # CHECK-NEXT:         "message": "Included header all2.h is not used directly (fixes available)",
101 # CHECK-NEXT:         "range": {
102 # CHECK-NEXT:           "end": {
103 # CHECK-NEXT:             "character": 17,
104 # CHECK-NEXT:             "line": 1
105 # CHECK-NEXT:           },
106 # CHECK-NEXT:           "start": {
107 # CHECK-NEXT:             "character": 0,
108 # CHECK-NEXT:             "line": 1
109 # CHECK-NEXT:           }
110 # CHECK-NEXT:         },
111 # CHECK-NEXT:         "severity": 2,
112 # CHECK-NEXT:         "source": "clangd",
113 # CHECK-NEXT:         "tags": [
114 # CHECK-NEXT:           1
115 # CHECK-NEXT:         ]
116 # CHECK-NEXT:       }
117 # CHECK-NEXT:     ],
118 # CHECK-NEXT:     "uri": "file://{{.*}}/simple.cpp",
119 # CHECK-NEXT:     "version": 0
120 # CHECK-NEXT:   }
122 {"jsonrpc":"2.0","id":2,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"test:///simple.cpp"},"range":{"start":{"line":2,"character":1},"end":{"line":2,"character":4}},"context":{"diagnostics":[{"range":{"start": {"line": 2, "character": 1}, "end": {"line": 2, "character": 4}},"severity":3,"message":"No header providing \"Foo\" is directly included (fixes available)", "code": "missing-includes", "source": "clangd"}]}}}
123 #      CHECK:  "id": 2,
124 # CHECK-NEXT:  "jsonrpc": "2.0",
125 # CHECK-NEXT:  "result": [
126 # CHECK-NEXT:    {
127 # CHECK-NEXT:      "arguments": [
128 # CHECK-NEXT:        {
129 # CHECK-NEXT:          "documentChanges": [
130 # CHECK-NEXT:            {
131 # CHECK-NEXT:              "edits": [
132 # CHECK-NEXT:                {
133 # CHECK-NEXT:                  "newText": "#include {{.*}}foo.h{{.*}}",
134 # CHECK-NEXT:                  "range": {
135 # CHECK-NEXT:                    "end": {
136 # CHECK-NEXT:                      "character": 0,
137 # CHECK-NEXT:                      "line": 2
138 # CHECK-NEXT:                    },
139 # CHECK-NEXT:                    "start": {
140 # CHECK-NEXT:                      "character": 0,
141 # CHECK-NEXT:                      "line": 2
142 # CHECK-NEXT:                    }
143 # CHECK-NEXT:                  }
144 # CHECK-NEXT:                }
145 # CHECK-NEXT:              ],
146 # CHECK-NEXT:              "textDocument": {
147 # CHECK-NEXT:                "uri": "file://{{.*}}/simple.cpp",
148 # CHECK-NEXT:                "version": 0
149 # CHECK-NEXT:              }
150 # CHECK-NEXT:            }
151 # CHECK-NEXT:          ]
152 # CHECK-NEXT:        }
153 # CHECK-NEXT:      ],
154 # CHECK-NEXT:      "command": "clangd.applyFix",
155 # CHECK-NEXT:      "title": "Apply fix: #include {{.*}}foo.h{{.*}}"
156 # CHECK-NEXT:    },
157 # CHECK-NEXT:    {
158 # CHECK-NEXT:      "arguments": [
159 # CHECK-NEXT:        {
160 # CHECK-NEXT:          "changeAnnotations": {
161 # CHECK-NEXT:            "AddAllMissingIncludes0": {
162 # CHECK-NEXT:              "label": "",
163 # CHECK-NEXT:              "needsConfirmation": true
164 # CHECK-NEXT:            },
165 # CHECK-NEXT:            "AddAllMissingIncludes1": {
166 # CHECK-NEXT:              "label": "",
167 # CHECK-NEXT:              "needsConfirmation": true
168 # CHECK-NEXT:            }
169 # CHECK-NEXT:          },
170 # CHECK-NEXT:          "documentChanges": [
171 # CHECK-NEXT:            {
172 # CHECK-NEXT:              "edits": [
173 # CHECK-NEXT:                {
174 # CHECK-NEXT:                  "annotationId": "AddAllMissingIncludes0",
175 # CHECK-NEXT:                  "newText": "#include {{.*}}bar.h{{.*}}",
176 # CHECK-NEXT:                  "range": {
177 # CHECK-NEXT:                    "end": {
178 # CHECK-NEXT:                      "character": 0,
179 # CHECK-NEXT:                      "line": 2
180 # CHECK-NEXT:                    },
181 # CHECK-NEXT:                    "start": {
182 # CHECK-NEXT:                      "character": 0,
183 # CHECK-NEXT:                      "line": 2
184 # CHECK-NEXT:                    }
185 # CHECK-NEXT:                  }
186 # CHECK-NEXT:                },
187 # CHECK-NEXT:                {
188 # CHECK-NEXT:                  "annotationId": "AddAllMissingIncludes1",
189 # CHECK-NEXT:                  "newText": "#include {{.*}}foo.h{{.*}}",
190 # CHECK-NEXT:                  "range": {
191 # CHECK-NEXT:                    "end": {
192 # CHECK-NEXT:                      "character": 0,
193 # CHECK-NEXT:                      "line": 2
194 # CHECK-NEXT:                    },
195 # CHECK-NEXT:                    "start": {
196 # CHECK-NEXT:                      "character": 0,
197 # CHECK-NEXT:                      "line": 2
198 # CHECK-NEXT:                    }
199 # CHECK-NEXT:                  }
200 # CHECK-NEXT:                }
201 # CHECK-NEXT:              ],
202 # CHECK-NEXT:              "textDocument": {
203 # CHECK-NEXT:                "uri": "file://{{.*}}/simple.cpp",
204 # CHECK-NEXT:                "version": 0
205 # CHECK-NEXT:              }
206 # CHECK-NEXT:            }
207 # CHECK-NEXT:          ]
208 # CHECK-NEXT:        }
209 # CHECK-NEXT:      ],
210 # CHECK-NEXT:      "command": "clangd.applyFix",
211 # CHECK-NEXT:      "title": "Apply fix: add all missing includes"
212 # CHECK-NEXT:    },
213 # CHECK-NEXT:    {
214 # CHECK-NEXT:      "arguments": [
215 # CHECK-NEXT:        {
216 # CHECK-NEXT:          "changeAnnotations": {
217 # CHECK-NEXT:            "AddAllMissingIncludes0": {
218 # CHECK-NEXT:              "label": "",
219 # CHECK-NEXT:              "needsConfirmation": true
220 # CHECK-NEXT:            },
221 # CHECK-NEXT:            "AddAllMissingIncludes1": {
222 # CHECK-NEXT:              "label": "",
223 # CHECK-NEXT:              "needsConfirmation": true
224 # CHECK-NEXT:            },
225 # CHECK-NEXT:            "RemoveAllUnusedIncludes0": {
226 # CHECK-NEXT:              "label": "",
227 # CHECK-NEXT:              "needsConfirmation": true
228 # CHECK-NEXT:            },
229 # CHECK-NEXT:            "RemoveAllUnusedIncludes1": {
230 # CHECK-NEXT:              "label": "",
231 # CHECK-NEXT:              "needsConfirmation": true
232 # CHECK-NEXT:            }
233 # CHECK-NEXT:          },
234 # CHECK-NEXT:          "documentChanges": [
235 # CHECK-NEXT:            {
236 # CHECK-NEXT:              "edits": [
237 # CHECK-NEXT:                {
238 # CHECK-NEXT:                  "annotationId": "RemoveAllUnusedIncludes0",
239 # CHECK-NEXT:                  "newText": "",
240 # CHECK-NEXT:                  "range": {
241 # CHECK-NEXT:                    "end": {
242 # CHECK-NEXT:                      "character": 0,
243 # CHECK-NEXT:                      "line": 1
244 # CHECK-NEXT:                    },
245 # CHECK-NEXT:                    "start": {
246 # CHECK-NEXT:                      "character": 0,
247 # CHECK-NEXT:                      "line": 0
248 # CHECK-NEXT:                    }
249 # CHECK-NEXT:                  }
250 # CHECK-NEXT:                },
251 # CHECK-NEXT:                {
252 # CHECK-NEXT:                  "annotationId": "RemoveAllUnusedIncludes1",
253 # CHECK-NEXT:                  "newText": "",
254 # CHECK-NEXT:                  "range": {
255 # CHECK-NEXT:                    "end": {
256 # CHECK-NEXT:                      "character": 0,
257 # CHECK-NEXT:                      "line": 2
258 # CHECK-NEXT:                    },
259 # CHECK-NEXT:                    "start": {
260 # CHECK-NEXT:                      "character": 0,
261 # CHECK-NEXT:                      "line": 1
262 # CHECK-NEXT:                    }
263 # CHECK-NEXT:                  }
264 # CHECK-NEXT:                },
265 # CHECK-NEXT:                {
266 # CHECK-NEXT:                  "annotationId": "AddAllMissingIncludes0",
267 # CHECK-NEXT:                  "newText": "#include {{.*}}bar.h{{.*}}",
268 # CHECK-NEXT:                  "range": {
269 # CHECK-NEXT:                    "end": {
270 # CHECK-NEXT:                      "character": 0,
271 # CHECK-NEXT:                      "line": 2
272 # CHECK-NEXT:                    },
273 # CHECK-NEXT:                    "start": {
274 # CHECK-NEXT:                      "character": 0,
275 # CHECK-NEXT:                      "line": 2
276 # CHECK-NEXT:                    }
277 # CHECK-NEXT:                  }
278 # CHECK-NEXT:                },
279 # CHECK-NEXT:                {
280 # CHECK-NEXT:                  "annotationId": "AddAllMissingIncludes1",
281 # CHECK-NEXT:                  "newText": "#include {{.*}}foo.h{{.*}}",
282 # CHECK-NEXT:                  "range": {
283 # CHECK-NEXT:                    "end": {
284 # CHECK-NEXT:                      "character": 0,
285 # CHECK-NEXT:                      "line": 2
286 # CHECK-NEXT:                    },
287 # CHECK-NEXT:                    "start": {
288 # CHECK-NEXT:                      "character": 0,
289 # CHECK-NEXT:                      "line": 2
290 # CHECK-NEXT:                    }
291 # CHECK-NEXT:                  }
292 # CHECK-NEXT:                }
293 # CHECK-NEXT:              ],
294 # CHECK-NEXT:              "textDocument": {
295 # CHECK-NEXT:                "uri": "file://{{.*}}/simple.cpp",
296 # CHECK-NEXT:                "version": 0
297 # CHECK-NEXT:              }
298 # CHECK-NEXT:            }
299 # CHECK-NEXT:          ]
300 # CHECK-NEXT:        }
301 # CHECK-NEXT:      ],
302 # CHECK-NEXT:      "command": "clangd.applyFix",
303 # CHECK-NEXT:      "title": "Apply fix: fix all includes"
304 # CHECK-NEXT:    }
305 # CHECK-NEXT:  ]
307 {"jsonrpc":"2.0","id":3,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"test:///simple.cpp"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":17}},"context":{"diagnostics":[{"range":{"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 17}},"severity":2,"message":"Included header all1.h is not used directly (fixes available)", "code": "unused-includes", "source": "clangd"}]}}}
308 #      CHECK:  "id": 3,
309 # CHECK-NEXT:  "jsonrpc": "2.0",
310 # CHECK-NEXT:  "result": [
311 # CHECK-NEXT:    {
312 # CHECK-NEXT:      "arguments": [
313 # CHECK-NEXT:        {
314 # CHECK-NEXT:          "documentChanges": [
315 # CHECK-NEXT:            {
316 # CHECK-NEXT:              "edits": [
317 # CHECK-NEXT:                {
318 # CHECK-NEXT:                  "newText": "",
319 # CHECK-NEXT:                  "range": {
320 # CHECK-NEXT:                    "end": {
321 # CHECK-NEXT:                      "character": 0,
322 # CHECK-NEXT:                      "line": 1
323 # CHECK-NEXT:                    },
324 # CHECK-NEXT:                    "start": {
325 # CHECK-NEXT:                      "character": 0,
326 # CHECK-NEXT:                      "line": 0
327 # CHECK-NEXT:                    }
328 # CHECK-NEXT:                  }
329 # CHECK-NEXT:                }
330 # CHECK-NEXT:              ],
331 # CHECK-NEXT:              "textDocument": {
332 # CHECK-NEXT:                "uri": "file://{{.*}}/simple.cpp",
333 # CHECK-NEXT:                "version": 0
334 # CHECK-NEXT:              }
335 # CHECK-NEXT:            }
336 # CHECK-NEXT:          ]
337 # CHECK-NEXT:        }
338 # CHECK-NEXT:      ],
339 # CHECK-NEXT:      "command": "clangd.applyFix",
340 # CHECK-NEXT:      "title": "Apply fix: remove #include directive"
341 # CHECK-NEXT:    },
342 # CHECK-NEXT:    {
343 # CHECK-NEXT:      "arguments": [
344 # CHECK-NEXT:        {
345 # CHECK-NEXT:          "changeAnnotations": {
346 # CHECK-NEXT:            "RemoveAllUnusedIncludes0": {
347 # CHECK-NEXT:              "label": "",
348 # CHECK-NEXT:              "needsConfirmation": true
349 # CHECK-NEXT:            },
350 # CHECK-NEXT:            "RemoveAllUnusedIncludes1": {
351 # CHECK-NEXT:              "label": "",
352 # CHECK-NEXT:              "needsConfirmation": true
353 # CHECK-NEXT:            }
354 # CHECK-NEXT:          },
355 # CHECK-NEXT:          "documentChanges": [
356 # CHECK-NEXT:            {
357 # CHECK-NEXT:              "edits": [
358 # CHECK-NEXT:                {
359 # CHECK-NEXT:                  "annotationId": "RemoveAllUnusedIncludes0",
360 # CHECK-NEXT:                  "newText": "",
361 # CHECK-NEXT:                  "range": {
362 # CHECK-NEXT:                    "end": {
363 # CHECK-NEXT:                      "character": 0,
364 # CHECK-NEXT:                      "line": 1
365 # CHECK-NEXT:                    },
366 # CHECK-NEXT:                    "start": {
367 # CHECK-NEXT:                      "character": 0,
368 # CHECK-NEXT:                      "line": 0
369 # CHECK-NEXT:                    }
370 # CHECK-NEXT:                  }
371 # CHECK-NEXT:                },
372 # CHECK-NEXT:                {
373 # CHECK-NEXT:                  "annotationId": "RemoveAllUnusedIncludes1",
374 # CHECK-NEXT:                  "newText": "",
375 # CHECK-NEXT:                  "range": {
376 # CHECK-NEXT:                    "end": {
377 # CHECK-NEXT:                      "character": 0,
378 # CHECK-NEXT:                      "line": 2
379 # CHECK-NEXT:                    },
380 # CHECK-NEXT:                    "start": {
381 # CHECK-NEXT:                      "character": 0,
382 # CHECK-NEXT:                      "line": 1
383 # CHECK-NEXT:                    }
384 # CHECK-NEXT:                  }
385 # CHECK-NEXT:                }
386 # CHECK-NEXT:              ],
387 # CHECK-NEXT:              "textDocument": {
388 # CHECK-NEXT:                "uri": "file://{{.*}}/simple.cpp",
389 # CHECK-NEXT:                "version": 0
390 # CHECK-NEXT:              }
391 # CHECK-NEXT:            }
392 # CHECK-NEXT:          ]
393 # CHECK-NEXT:        }
394 # CHECK-NEXT:      ],
395 # CHECK-NEXT:      "command": "clangd.applyFix",
396 # CHECK-NEXT:      "title": "Apply fix: remove all unused includes"
397 # CHECK-NEXT:    },
398 # CHECK-NEXT:    {
399 # CHECK-NEXT:      "arguments": [
400 # CHECK-NEXT:        {
401 # CHECK-NEXT:          "changeAnnotations": {
402 # CHECK-NEXT:            "AddAllMissingIncludes0": {
403 # CHECK-NEXT:              "label": "",
404 # CHECK-NEXT:              "needsConfirmation": true
405 # CHECK-NEXT:            },
406 # CHECK-NEXT:            "AddAllMissingIncludes1": {
407 # CHECK-NEXT:              "label": "",
408 # CHECK-NEXT:              "needsConfirmation": true
409 # CHECK-NEXT:            },
410 # CHECK-NEXT:            "RemoveAllUnusedIncludes0": {
411 # CHECK-NEXT:              "label": "",
412 # CHECK-NEXT:              "needsConfirmation": true
413 # CHECK-NEXT:            },
414 # CHECK-NEXT:            "RemoveAllUnusedIncludes1": {
415 # CHECK-NEXT:              "label": "",
416 # CHECK-NEXT:              "needsConfirmation": true
417 # CHECK-NEXT:            }
418 # CHECK-NEXT:          },
419 # CHECK-NEXT:          "documentChanges": [
420 # CHECK-NEXT:            {
421 # CHECK-NEXT:              "edits": [
422 # CHECK-NEXT:                {
423 # CHECK-NEXT:                  "annotationId": "RemoveAllUnusedIncludes0",
424 # CHECK-NEXT:                  "newText": "",
425 # CHECK-NEXT:                  "range": {
426 # CHECK-NEXT:                    "end": {
427 # CHECK-NEXT:                      "character": 0,
428 # CHECK-NEXT:                      "line": 1
429 # CHECK-NEXT:                    },
430 # CHECK-NEXT:                    "start": {
431 # CHECK-NEXT:                      "character": 0,
432 # CHECK-NEXT:                      "line": 0
433 # CHECK-NEXT:                    }
434 # CHECK-NEXT:                  }
435 # CHECK-NEXT:                },
436 # CHECK-NEXT:                {
437 # CHECK-NEXT:                  "annotationId": "RemoveAllUnusedIncludes1",
438 # CHECK-NEXT:                  "newText": "",
439 # CHECK-NEXT:                  "range": {
440 # CHECK-NEXT:                    "end": {
441 # CHECK-NEXT:                      "character": 0,
442 # CHECK-NEXT:                      "line": 2
443 # CHECK-NEXT:                    },
444 # CHECK-NEXT:                    "start": {
445 # CHECK-NEXT:                      "character": 0,
446 # CHECK-NEXT:                      "line": 1
447 # CHECK-NEXT:                    }
448 # CHECK-NEXT:                  }
449 # CHECK-NEXT:                },
450 # CHECK-NEXT:                {
451 # CHECK-NEXT:                  "annotationId": "AddAllMissingIncludes0",
452 # CHECK-NEXT:                  "newText": "#include {{.*}}bar.h{{.*}}",
453 # CHECK-NEXT:                  "range": {
454 # CHECK-NEXT:                    "end": {
455 # CHECK-NEXT:                      "character": 0,
456 # CHECK-NEXT:                      "line": 2
457 # CHECK-NEXT:                    },
458 # CHECK-NEXT:                    "start": {
459 # CHECK-NEXT:                      "character": 0,
460 # CHECK-NEXT:                      "line": 2
461 # CHECK-NEXT:                    }
462 # CHECK-NEXT:                  }
463 # CHECK-NEXT:                },
464 # CHECK-NEXT:                {
465 # CHECK-NEXT:                  "annotationId": "AddAllMissingIncludes1",
466 # CHECK-NEXT:                  "newText": "#include {{.*}}foo.h{{.*}}",
467 # CHECK-NEXT:                  "range": {
468 # CHECK-NEXT:                    "end": {
469 # CHECK-NEXT:                      "character": 0,
470 # CHECK-NEXT:                      "line": 2
471 # CHECK-NEXT:                    },
472 # CHECK-NEXT:                    "start": {
473 # CHECK-NEXT:                      "character": 0,
474 # CHECK-NEXT:                      "line": 2
475 # CHECK-NEXT:                    }
476 # CHECK-NEXT:                  }
477 # CHECK-NEXT:                }
478 # CHECK-NEXT:              ],
479 # CHECK-NEXT:              "textDocument": {
480 # CHECK-NEXT:                "uri": "file://{{.*}}/simple.cpp",
481 # CHECK-NEXT:                "version": 0
482 # CHECK-NEXT:              }
483 # CHECK-NEXT:            }
484 # CHECK-NEXT:          ]
485 # CHECK-NEXT:        }
486 # CHECK-NEXT:      ],
487 # CHECK-NEXT:      "command": "clangd.applyFix",
488 # CHECK-NEXT:      "title": "Apply fix: fix all includes"
489 # CHECK-NEXT:    }
490 # CHECK-NEXT:  ]
492 {"jsonrpc":"2.0","id":4,"method":"shutdown"}
494 {"jsonrpc":"2.0","method":"exit"}