| # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s -implicit-check-not=semanticHighlight |
| # Send capabilities for both Theia semanticHighlight & standard semanticTokens. |
| # clangd should not use/acknowledge the Theia protocol in this case. |
| {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"capabilities":{"textDocument":{ |
| "semanticHighlightingCapabilities":{"semanticHighlighting":true}, |
| "semanticTokens":{"dynamicRegistration":true} |
| }}}} |
| --- |
| {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.cpp","languageId":"cpp","text":"int x = 2;"}}} |
| --- |
| {"jsonrpc":"2.0","id":1,"method":"textDocument/semanticTokens","params":{"textDocument":{"uri":"test:///foo.cpp"}}} |
| # CHECK: "id": 1, |
| # CHECK-NEXT: "jsonrpc": "2.0", |
| # CHECK-NEXT: "result": { |
| # CHECK-NEXT: "data": [ |
| # First line, char 5, variable, no modifiers. |
| # CHECK-NEXT: 0, |
| # CHECK-NEXT: 4, |
| # CHECK-NEXT: 1, |
| # CHECK-NEXT: 0, |
| # CHECK-NEXT: 0 |
| # CHECK-NEXT: ] |
| # CHECK-NEXT: } |
| --- |
| {"jsonrpc":"2.0","id":2,"method":"shutdown"} |
| --- |
| {"jsonrpc":"2.0","method":"exit"} |