[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / clangd / test / code-action-request.test
blobf1511f58f561fe702c1bb01c6291c4d85453ecb9
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"}}
3 ---
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"auto i = 0;"}}}
5 ---
7         "jsonrpc": "2.0",
8         "id": 1,
9         "method": "textDocument/codeAction",
10         "params": {
11                 "textDocument": {
12                         "uri": "test:///main.cpp"
13                 },
14         "range": {
15             "start": {
16                 "line": 0,
17                 "character": 0
18             },
19             "end": {
20                 "line": 0,
21                 "character": 4
22             }
23         },
24         "context": {
25             "diagnostics": []
26         }
27     }
29 #      CHECK:  "id": 1,
30 # CHECK-NEXT:  "jsonrpc": "2.0",
31 # CHECK-NEXT:  "result": [
32 # CHECK-NEXT:    {
33 # CHECK-NEXT:      "arguments": [
34 # CHECK-NEXT:        {
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
40 # CHECK-NEXT:            },
41 # CHECK-NEXT:            "start": {
42 # CHECK-NEXT:              "character": 0,
43 # CHECK-NEXT:              "line": 0
44 # CHECK-NEXT:            }
45 # CHECK-NEXT:          },
46 # CHECK-NEXT:          "tweakID": "ExpandDeducedType"
47 # CHECK-NEXT:        }
48 # CHECK-NEXT:      ],
49 # CHECK-NEXT:      "command": "clangd.applyTweak",
50 # CHECK-NEXT:      "title": "Replace with deduced type"
51 # CHECK-NEXT:    }
52 # CHECK-NEXT:  ]
53 ---
55   "jsonrpc": "2.0",
56   "id": 2,
57   "method": "textDocument/codeAction",
58   "params": {
59     "textDocument": { "uri": "test:///main.cpp" },
60         "range": {
61             "start": {"line": 0, "character": 0},
62             "end": {"line": 0, "character": 4}
63         },
64         "context": {
65             "diagnostics": [],
66             "only": ["quickfix"]
67         }
68     }
70 #      CHECK:  "id": 2,
71 # CHECK-NEXT:  "jsonrpc": "2.0",
72 # CHECK-NEXT:  "result": []
73 ---
75   "jsonrpc": "2.0",
76   "id": 3,
77   "method": "textDocument/codeAction",
78   "params": {
79     "textDocument": { "uri": "test:///main.cpp" },
80         "range": {
81             "start": {"line": 0, "character": 0},
82             "end": {"line": 0, "character": 4}
83         },
84         "context": {
85             "diagnostics": [],
86             "only": ["refactor"]
87         }
88     }
90 #      CHECK:  "id": 3,
91 # CHECK-NEXT:  "jsonrpc": "2.0",
92 # CHECK-NEXT:  "result": [
93 # CHECK-NEXT:    {
94 ---
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
101 # CHECK-NEXT:      },
102 # CHECK-NEXT:      "start": {
103 # CHECK-NEXT:        "character": 0,
104 # CHECK-NEXT:        "line": 0
105 # CHECK-NEXT:      }
106 # CHECK-NEXT:    }
108 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
110 {"jsonrpc":"2.0","method":"exit"}