1 # RUN: clangd -log=verbose -lit-test < %s | FileCheck -strict-whitespace %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.cpp","languageId":"cpp","version":1,"text":"auto i = 0;"}}}
9 "method": "textDocument/codeAction",
12 "uri": "test:///main.cpp"
30 # CHECK-NEXT: "jsonrpc": "2.0",
31 # CHECK-NEXT: "result": [
33 # CHECK-NEXT: "arguments": [
35 # CHECK-NEXT: "file": "file://{{.*}}/clangd-test/main.cpp",
36 # CHECK-NEXT: "selection": {
37 # CHECK-NEXT: "end": {
38 # CHECK-NEXT: "character": 4,
39 # CHECK-NEXT: "line": 0
41 # CHECK-NEXT: "start": {
42 # CHECK-NEXT: "character": 0,
43 # CHECK-NEXT: "line": 0
46 # CHECK-NEXT: "tweakID": "ExpandDeducedType"
49 # CHECK-NEXT: "command": "clangd.applyTweak",
50 # CHECK-NEXT: "title": "Replace with deduced type"
57 "method": "textDocument/codeAction",
59 "textDocument": { "uri": "test:///main.cpp" },
61 "start": {"line": 0, "character": 0},
62 "end": {"line": 0, "character": 4}
71 # CHECK-NEXT: "jsonrpc": "2.0",
72 # CHECK-NEXT: "result": []
77 "method": "textDocument/codeAction",
79 "textDocument": { "uri": "test:///main.cpp" },
81 "start": {"line": 0, "character": 0},
82 "end": {"line": 0, "character": 4}
91 # CHECK-NEXT: "jsonrpc": "2.0",
92 # CHECK-NEXT: "result": [
95 {"jsonrpc":"2.0","id":4,"method":"workspace/executeCommand","params":{"command":"clangd.applyTweak","arguments":[{"file":"test:///main.cpp","selection":{"end":{"character":4,"line":0},"start":{"character":0,"line":0}},"tweakID":"ExpandDeducedType"}]}}
96 # CHECK: "newText": "int",
97 # CHECK-NEXT: "range": {
98 # CHECK-NEXT: "end": {
99 # CHECK-NEXT: "character": 4,
100 # CHECK-NEXT: "line": 0
102 # CHECK-NEXT: "start": {
103 # CHECK-NEXT: "character": 0,
104 # CHECK-NEXT: "line": 0
108 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
110 {"jsonrpc":"2.0","method":"exit"}