|
| 1 | +[ |
| 2 | + { |
| 3 | + "comment": [ |
| 4 | + "Checks that Sort Dependencies refactoring code action is correctly provided and executed when a prelude range is selected." |
| 5 | + ] |
| 6 | + }, |
| 7 | + { |
| 8 | + "start": { |
| 9 | + "cmd": [ |
| 10 | + "${ALS}" |
| 11 | + ] |
| 12 | + } |
| 13 | + }, |
| 14 | + { |
| 15 | + "send": { |
| 16 | + "request": { |
| 17 | + "jsonrpc": "2.0", |
| 18 | + "id": 0, |
| 19 | + "method": "initialize", |
| 20 | + "params": { |
| 21 | + "processId": 59002, |
| 22 | + "locale": "en-gb", |
| 23 | + "rootPath": "$URI{.}", |
| 24 | + "rootUri": "$URI{.}", |
| 25 | + "capabilities": { |
| 26 | + "workspace": { |
| 27 | + "applyEdit": true, |
| 28 | + "workspaceEdit": { |
| 29 | + "documentChanges": true, |
| 30 | + "resourceOperations": [ |
| 31 | + "create", |
| 32 | + "rename", |
| 33 | + "delete" |
| 34 | + ] |
| 35 | + }, |
| 36 | + "executeCommand": { |
| 37 | + "dynamicRegistration": true |
| 38 | + } |
| 39 | + }, |
| 40 | + "textDocument": { |
| 41 | + "codeAction": { |
| 42 | + "dynamicRegistration": true, |
| 43 | + "codeActionLiteralSupport": { |
| 44 | + "codeActionKind": { |
| 45 | + "valueSet": [ |
| 46 | + "refactor", |
| 47 | + "refactor.extract", |
| 48 | + "refactor.inline", |
| 49 | + "refactor.rewrite" |
| 50 | + ] |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + }, |
| 55 | + "experimental": { |
| 56 | + "advanced_refactorings": [ |
| 57 | + "replace_type" |
| 58 | + ] |
| 59 | + } |
| 60 | + } |
| 61 | + } |
| 62 | + }, |
| 63 | + "wait": [ |
| 64 | + { |
| 65 | + "jsonrpc": "2.0", |
| 66 | + "id": 0, |
| 67 | + "result": { |
| 68 | + "capabilities": { |
| 69 | + "codeActionProvider": { |
| 70 | + "codeActionKinds": [ |
| 71 | + "<HAS>", |
| 72 | + "refactor.rewrite" |
| 73 | + ] |
| 74 | + }, |
| 75 | + "executeCommandProvider": { |
| 76 | + "commands": [ |
| 77 | + "<HAS>", |
| 78 | + "als-refactor-sort_dependencies" |
| 79 | + ] |
| 80 | + } |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | + ] |
| 85 | + } |
| 86 | + }, |
| 87 | + { |
| 88 | + "send": { |
| 89 | + "request": { |
| 90 | + "jsonrpc": "2.0", |
| 91 | + "method": "workspace/didChangeConfiguration", |
| 92 | + "params": { |
| 93 | + "settings": { |
| 94 | + "ada": { |
| 95 | + "trace": { |
| 96 | + "server": "off" |
| 97 | + }, |
| 98 | + "projectFile": "default.gpr", |
| 99 | + "scenarioVariables": {}, |
| 100 | + "defaultCharset": "iso-8859-1", |
| 101 | + "displayMethodAncestryOnNavigation": "usage_and_abstract_only", |
| 102 | + "enableDiagnostics": true, |
| 103 | + "useCompletionSnippets": false, |
| 104 | + "renameInComments": false |
| 105 | + } |
| 106 | + } |
| 107 | + } |
| 108 | + }, |
| 109 | + "wait": [ |
| 110 | + { |
| 111 | + "jsonrpc": "2.0", |
| 112 | + "id": 1, |
| 113 | + "method": "window/workDoneProgress/create", |
| 114 | + "params": { |
| 115 | + "token": "<ANY>" |
| 116 | + } |
| 117 | + } |
| 118 | + ] |
| 119 | + } |
| 120 | + }, |
| 121 | + { |
| 122 | + "send": { |
| 123 | + "request": { |
| 124 | + "jsonrpc": "2.0", |
| 125 | + "method": "initialized", |
| 126 | + "params": {} |
| 127 | + }, |
| 128 | + "wait": [] |
| 129 | + } |
| 130 | + }, |
| 131 | + { |
| 132 | + "send": { |
| 133 | + "request": { |
| 134 | + "jsonrpc": "2.0", |
| 135 | + "method": "textDocument/didOpen", |
| 136 | + "params": { |
| 137 | + "textDocument": { |
| 138 | + "uri": "$URI{main_package.ads}", |
| 139 | + "languageId": "ada", |
| 140 | + "version": 1, |
| 141 | + "text": "pragma Ada_2012;\n\n-- Comment 1\nwith Ada.Containers; -- Comment 2\n-- Comment 3\nprivate with Ada.Finalization; -- Comment 4\n-- Comment 5\nwith Ada.Strings.Unbounded; -- Comment 6\nprivate with Ada.Unchecked_Deallocation; -- Comment 7\n-- Comment 8\n\n-- Comment 9\n-- Comment 10\nprivate with Qux; -- Comment 11\npragma Elaborate (Qux); -- Comment 12\n\n-- Comment 13\n-- Comment 14\n\n-- Comment 15\n\n-- Comment 16\n-- Comment 17\n-- Comment 18\nwith Foo; -- Comment 19\npragma Elaborate_All (Foo);\npragma Warnings (Off, -- Comment 20\n Foo); -- Comment 21\n-- Comment 22\n\nlimited with Corge;\n-- Comment 23\nwith Bar; use Bar; -- Comment 24\n-- Comment 25\npragma Warnings (Off, -- Comment 26\n Bar);\n\nuse Foo;\n-- Comment 27\n-- Comment 28\n\nwith Ada.Strings;\nwith Ada.Containers.Vectors;\nwith Ada.Containers.Hashed_Sets;\n\nwith Ada.Strings.Hash;\n-- Comment 29\n-- Comment 30\n\n\n\npackage Main_Package is\n pragma Elaborate_Body;\n\nend Main_Package;\n" |
| 142 | + } |
| 143 | + } |
| 144 | + }, |
| 145 | + "wait": [] |
| 146 | + } |
| 147 | + }, |
| 148 | + { |
| 149 | + "send": { |
| 150 | + "request": { |
| 151 | + "jsonrpc": "2.0", |
| 152 | + "id": 1, |
| 153 | + "method": "textDocument/codeAction", |
| 154 | + "params": { |
| 155 | + "textDocument": { |
| 156 | + "uri": "$URI{main_package.ads}" |
| 157 | + }, |
| 158 | + "range": { |
| 159 | + "start": { |
| 160 | + "line": 41, |
| 161 | + "character": 1 |
| 162 | + }, |
| 163 | + "end": { |
| 164 | + "line": 43, |
| 165 | + "character": 3 |
| 166 | + } |
| 167 | + }, |
| 168 | + "context": { |
| 169 | + "diagnostics": [] |
| 170 | + } |
| 171 | + } |
| 172 | + }, |
| 173 | + "wait": [ |
| 174 | + { |
| 175 | + "jsonrpc": "2.0", |
| 176 | + "id": 1, |
| 177 | + "result": [ |
| 178 | + { |
| 179 | + "title": "Sort Dependencies", |
| 180 | + "kind": "refactor", |
| 181 | + "command": { |
| 182 | + "title": "", |
| 183 | + "command": "als-refactor-sort_dependencies", |
| 184 | + "arguments": [ |
| 185 | + { |
| 186 | + "context": "Default", |
| 187 | + "where": { |
| 188 | + "uri": "$URI{main_package.ads}", |
| 189 | + "range": { |
| 190 | + "start": { |
| 191 | + "line": 41, |
| 192 | + "character": 1 |
| 193 | + }, |
| 194 | + "end": { |
| 195 | + "line": 43, |
| 196 | + "character": 3 |
| 197 | + } |
| 198 | + } |
| 199 | + } |
| 200 | + } |
| 201 | + ] |
| 202 | + } |
| 203 | + } |
| 204 | + ] |
| 205 | + } |
| 206 | + ] |
| 207 | + } |
| 208 | + }, |
| 209 | + { |
| 210 | + "send": { |
| 211 | + "request": { |
| 212 | + "jsonrpc": "2.0", |
| 213 | + "id": 3, |
| 214 | + "method": "workspace/executeCommand", |
| 215 | + "params": { |
| 216 | + "command": "als-refactor-sort_dependencies", |
| 217 | + "arguments": [ |
| 218 | + { |
| 219 | + "context": "Default", |
| 220 | + "where": { |
| 221 | + "uri": "$URI{main_package.ads}", |
| 222 | + "range": { |
| 223 | + "start": { |
| 224 | + "line": 41, |
| 225 | + "character": 1 |
| 226 | + }, |
| 227 | + "end": { |
| 228 | + "line": 43, |
| 229 | + "character": 3 |
| 230 | + } |
| 231 | + } |
| 232 | + } |
| 233 | + } |
| 234 | + ] |
| 235 | + } |
| 236 | + }, |
| 237 | + "wait": [ |
| 238 | + { |
| 239 | + "jsonrpc": "2.0", |
| 240 | + "id": 2, |
| 241 | + "method": "workspace/applyEdit", |
| 242 | + "params": { |
| 243 | + "label": "Sort Dependencies", |
| 244 | + "edit": { |
| 245 | + "documentChanges": [ |
| 246 | + { |
| 247 | + "textDocument": { |
| 248 | + "uri": "$URI{main_package.ads}", |
| 249 | + "version": 1 |
| 250 | + }, |
| 251 | + "edits": [ |
| 252 | + { |
| 253 | + "range": { |
| 254 | + "start": { |
| 255 | + "line": 41, |
| 256 | + "character": 0 |
| 257 | + }, |
| 258 | + "end": { |
| 259 | + "line": 43, |
| 260 | + "character": 32 |
| 261 | + } |
| 262 | + }, |
| 263 | + "newText": "with Ada.Containers.Hashed_Sets;\nwith Ada.Containers.Vectors;\nwith Ada.Strings;" |
| 264 | + } |
| 265 | + ] |
| 266 | + } |
| 267 | + ] |
| 268 | + } |
| 269 | + } |
| 270 | + } |
| 271 | + ] |
| 272 | + } |
| 273 | + }, |
| 274 | + { |
| 275 | + "send": { |
| 276 | + "request": { |
| 277 | + "jsonrpc": "2.0", |
| 278 | + "id": 4, |
| 279 | + "method": "shutdown" |
| 280 | + }, |
| 281 | + "wait": [ |
| 282 | + { |
| 283 | + "id": 4, |
| 284 | + "result": null |
| 285 | + } |
| 286 | + ] |
| 287 | + } |
| 288 | + }, |
| 289 | + { |
| 290 | + "stop": { |
| 291 | + "exit_code": 0 |
| 292 | + } |
| 293 | + } |
| 294 | +] |
0 commit comments