1 # RUN: clangd -lit-test < %s | FileCheck %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:///main.cc","languageId":"cpp","version":1,"text":"int f() { if (true) { return 1; } else {} }"}}}
6 {"jsonrpc":"2.0","id":5,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"test:///main.cc"},"range":{"start":{"line":0,"character":11},"end":{"line":0,"character":11}},"context":{"diagnostics":[]}}}
8 {"jsonrpc":"2.0","id":6,"method":"workspace/executeCommand","params":{"command":"clangd.applyTweak","arguments":[{"file":"test:///main.cc","selection":{"end":{"character":11,"line":0},"start":{"character":11,"line":0}},"tweakID":"SwapIfBranches"}]}}
9 # CHECK: "newText": "\n ",
10 # CHECK-NEXT: "range": {
11 # CHECK-NEXT: "end": {
12 # CHECK-NEXT: "character": 10,
13 # CHECK-NEXT: "line": 0
15 # CHECK-NEXT: "start": {
16 # CHECK-NEXT: "character": 9,
17 # CHECK-NEXT: "line": 0
22 # CHECK-NEXT: "newText": "{\n }",
23 # CHECK-NEXT: "range": {
24 # CHECK-NEXT: "end": {
25 # CHECK-NEXT: "character": 33,
26 # CHECK-NEXT: "line": 0
28 # CHECK-NEXT: "start": {
29 # CHECK-NEXT: "character": 20,
30 # CHECK-NEXT: "line": 0
35 # CHECK-NEXT: "newText": "{\n return 1;\n }\n",
36 # CHECK-NEXT: "range": {
37 # CHECK-NEXT: "end": {
38 # CHECK-NEXT: "character": 42,
39 # CHECK-NEXT: "line": 0
41 # CHECK-NEXT: "start": {
42 # CHECK-NEXT: "character": 39,
43 # CHECK-NEXT: "line": 0
48 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
50 {"jsonrpc":"2.0","method":"exit"}