|
| 1 | +[ |
| 2 | + { |
| 3 | + "comment": [ |
| 4 | + "Test semanticTokens to skip tokens not supported by a client.", |
| 5 | + "Initialize request skips `namespace` (package) token type and", |
| 6 | + "`declaration` token modifier. Server responses with 3 tokens:", |
| 7 | + "token `Ada` is skipped, because it is a package/namespace, so", |
| 8 | + "this token type isn't supported by the client.", |
| 9 | + "Next token `Unchecked_Conversion` is returned as `function`", |
| 10 | + "with `defaultLibrary` modifier. Then token `My_Type` as", |
| 11 | + "`type` with `static` modifier (and no `declaration` modifier).", |
| 12 | + "Then `Integer` as `type` and [`static` + `defaultLibrary`]", |
| 13 | + "modifier. Token types/modifiers encoding differs from", |
| 14 | + "'standard encoding' - the code decreased by one." |
| 15 | + ] |
| 16 | + }, |
| 17 | + { |
| 18 | + "start": { |
| 19 | + "cmd": [ |
| 20 | + "${ALS}" |
| 21 | + ] |
| 22 | + } |
| 23 | + }, |
| 24 | + { |
| 25 | + "send": { |
| 26 | + "request": { |
| 27 | + "params": { |
| 28 | + "processId": 31570, |
| 29 | + "capabilities": { |
| 30 | + "textDocument": { |
| 31 | + "completion": { |
| 32 | + "completionItem": { |
| 33 | + "documentationFormat": [ |
| 34 | + "plaintext", |
| 35 | + "markdown" |
| 36 | + ], |
| 37 | + "snippetSupport": true |
| 38 | + }, |
| 39 | + "dynamicRegistration": true |
| 40 | + }, |
| 41 | + "semanticTokens": { |
| 42 | + "refreshSupport":true, |
| 43 | + "dynamicRegistration":true, |
| 44 | + "tokenTypes": ["type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"], |
| 45 | + "tokenModifiers": ["definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"], |
| 46 | + "formats":["relative"], |
| 47 | + "requests": { |
| 48 | + "range": true, |
| 49 | + "full": true |
| 50 | + }, |
| 51 | + "overlappingTokenSupport" : true, |
| 52 | + "multilineTokenSupport" : true |
| 53 | + }, |
| 54 | + "definition": {}, |
| 55 | + "hover": {}, |
| 56 | + "formatting": { |
| 57 | + "dynamicRegistration": true |
| 58 | + }, |
| 59 | + "implementation": {}, |
| 60 | + "codeLens": {}, |
| 61 | + "typeDefinition": {}, |
| 62 | + "selectionRange": {}, |
| 63 | + "documentHighlight": {}, |
| 64 | + "documentSymbol": { |
| 65 | + "hierarchicalDocumentSymbolSupport": true |
| 66 | + }, |
| 67 | + "synchronization": {}, |
| 68 | + "references": {}, |
| 69 | + "rangeFormatting": {}, |
| 70 | + "onTypeFormatting": {}, |
| 71 | + "declaration": {}, |
| 72 | + "foldingRange": { |
| 73 | + "lineFoldingOnly": true |
| 74 | + }, |
| 75 | + "colorProvider": {} |
| 76 | + }, |
| 77 | + "workspace": { |
| 78 | + "applyEdit": true, |
| 79 | + "executeCommand": {}, |
| 80 | + "didChangeWatchedFiles": {}, |
| 81 | + "workspaceEdit": {}, |
| 82 | + "didChangeConfiguration": {}, |
| 83 | + "semanticTokens": { |
| 84 | + "refreshSupport": true |
| 85 | + } |
| 86 | + } |
| 87 | + }, |
| 88 | + "rootUri": "$URI{.}" |
| 89 | + }, |
| 90 | + "jsonrpc": "2.0", |
| 91 | + "id": 1, |
| 92 | + "method": "initialize" |
| 93 | + }, |
| 94 | + "wait": [ |
| 95 | + { |
| 96 | + "jsonrpc": "2.0", |
| 97 | + "id": 1, |
| 98 | + "result": { |
| 99 | + "capabilities": { |
| 100 | + "textDocumentSync": 2, |
| 101 | + "completionProvider": { |
| 102 | + "triggerCharacters": [ |
| 103 | + ".", |
| 104 | + ",", |
| 105 | + "'", |
| 106 | + "(" |
| 107 | + ], |
| 108 | + "resolveProvider": true |
| 109 | + }, |
| 110 | + "semanticTokensProvider": { |
| 111 | + "legend": { |
| 112 | + "tokenTypes": ["type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","function","keyword","modifier","comment","string","number","operator"], |
| 113 | + "tokenModifiers": ["definition","readonly","static","deprecated","abstract","modification","documentation","defaultLibrary"] |
| 114 | + }, |
| 115 | + "range": true, |
| 116 | + "full": {} |
| 117 | + }, |
| 118 | + "hoverProvider": true, |
| 119 | + "declarationProvider": true, |
| 120 | + "definitionProvider": true, |
| 121 | + "typeDefinitionProvider": true, |
| 122 | + "implementationProvider": true, |
| 123 | + "referencesProvider": true, |
| 124 | + "codeActionProvider": { |
| 125 | + }, |
| 126 | + "renameProvider": { |
| 127 | + }, |
| 128 | + "foldingRangeProvider": true, |
| 129 | + "executeCommandProvider": {}, |
| 130 | + "alsReferenceKinds": [ |
| 131 | + "reference", |
| 132 | + "access", |
| 133 | + "write", |
| 134 | + "call", |
| 135 | + "dispatching call", |
| 136 | + "parent", |
| 137 | + "child", |
| 138 | + "overriding" |
| 139 | + ] |
| 140 | + } |
| 141 | + } |
| 142 | + } |
| 143 | + ] |
| 144 | + } |
| 145 | + }, |
| 146 | + { |
| 147 | + "send": { |
| 148 | + "request": { |
| 149 | + "jsonrpc": "2.0", |
| 150 | + "method": "initialized" |
| 151 | + }, |
| 152 | + "wait": [] |
| 153 | + } |
| 154 | + }, |
| 155 | + { |
| 156 | + "send": { |
| 157 | + "request": { |
| 158 | + "params": { |
| 159 | + "settings": { |
| 160 | + "ada": { |
| 161 | + "projectFile": "$URI{default.gpr}", |
| 162 | + "scenarioVariables": {}, |
| 163 | + "defaultCharset": "ISO-8859-1" |
| 164 | + } |
| 165 | + } |
| 166 | + }, |
| 167 | + "jsonrpc": "2.0", |
| 168 | + "method": "workspace/didChangeConfiguration" |
| 169 | + }, |
| 170 | + "wait": [] |
| 171 | + } |
| 172 | + }, |
| 173 | + { |
| 174 | + "send": { |
| 175 | + "request": { |
| 176 | + "jsonrpc": "2.0", |
| 177 | + "method": "textDocument/didOpen", |
| 178 | + "params": { |
| 179 | + "textDocument": { |
| 180 | + "uri": "$URI{foo.adb}", |
| 181 | + "languageId": "Ada", |
| 182 | + "version": 0, |
| 183 | + "text": "with Ada.Unchecked_Conversion;\nprocedure Foo is\n\n type My_Type is new Integer range 1 .. 10;\n\n X, Y : My_Type := 1; -- Decl with multiple defining names\nbegin\n X := Y + My_Type (9);\nend Foo;\n" |
| 184 | + } |
| 185 | + } |
| 186 | + }, |
| 187 | + "wait": [] |
| 188 | + } |
| 189 | + }, |
| 190 | + { |
| 191 | + "send": { |
| 192 | + "request": { |
| 193 | + "jsonrpc": "2.0", |
| 194 | + "id": 2, |
| 195 | + "method": "textDocument/semanticTokens/range", |
| 196 | + "params": { |
| 197 | + "textDocument": { |
| 198 | + "uri": "$URI{foo.adb}" |
| 199 | + }, |
| 200 | + "range": { |
| 201 | + "start": { |
| 202 | + "line": 0, |
| 203 | + "character": 0 |
| 204 | + }, |
| 205 | + "end": { |
| 206 | + "line": 4, |
| 207 | + "character": 0 |
| 208 | + } |
| 209 | + } |
| 210 | + } |
| 211 | + }, |
| 212 | + "wait": [ |
| 213 | + { |
| 214 | + "jsonrpc": "2.0", |
| 215 | + "id": 2, |
| 216 | + "result": { |
| 217 | + "data": [ |
| 218 | + 0, |
| 219 | + 9, |
| 220 | + 20, |
| 221 | + 10, |
| 222 | + 128, |
| 223 | + |
| 224 | + 1, |
| 225 | + 10, |
| 226 | + 3, |
| 227 | + 10, |
| 228 | + 0, |
| 229 | + |
| 230 | + 2, |
| 231 | + 8, |
| 232 | + 7, |
| 233 | + 0, |
| 234 | + 4, |
| 235 | + |
| 236 | + 0, |
| 237 | + 15, |
| 238 | + 7, |
| 239 | + 0, |
| 240 | + 132 |
| 241 | + ] |
| 242 | + } |
| 243 | + } |
| 244 | + ] |
| 245 | + } |
| 246 | + }, |
| 247 | + { |
| 248 | + "send": { |
| 249 | + "request": { |
| 250 | + "jsonrpc": "2.0", |
| 251 | + "method": "textDocument/didClose", |
| 252 | + "params": { |
| 253 | + "textDocument": { |
| 254 | + "uri": "$URI{foo.adb}" |
| 255 | + } |
| 256 | + } |
| 257 | + }, |
| 258 | + "wait": [] |
| 259 | + } |
| 260 | + }, |
| 261 | + { |
| 262 | + "stop": { |
| 263 | + "exit_code": 0 |
| 264 | + } |
| 265 | + } |
| 266 | +] |
0 commit comments