| 1 |
# RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s |
| 2 |
# Verify versions get recorded/inferred, and are reported in publishDiagnostics. |
| 3 |
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{}} |
| 4 |
--- |
| 5 |
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","text":""}}} |
| 6 |
# CHECK: "version": 0 |
| 7 |
--- |
| 8 |
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"test:///foo.c","version":5},"contentChanges":[{"text":"a"}]}} |
| 9 |
# CHECK: "version": 5 |
| 10 |
--- |
| 11 |
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"test:///foo.c"},"contentChanges":[{"text":"b"}]}} |
| 12 |
# CHECK: "version": 6 |
| 13 |
--- |
| 14 |
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///bar.c","version": 42, "languageId":"c","text":""}}} |
| 15 |
# CHECK: "version": 42 |
| 16 |
--- |
| 17 |
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"test:///bar.c"},"contentChanges":[{"text":"c"}]}} |
| 18 |
# CHECK: "version": 43 |
| 19 |
--- |
| 20 |
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"test:///bar.c", "version": 123},"contentChanges":[{"text":"d"}]}} |
| 21 |
# CHECK: "version": 123 |
| 22 |
--- |
| 23 |
{"jsonrpc":"2.0","id":6,"method":"shutdown"} |
| 24 |
--- |
| 25 |
{"jsonrpc":"2.0","method":"exit"} |