1 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"capabilities":{
3 "workspace":{"semanticTokens":{"refreshSupport":true}}
6 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
7 "uri": "test:///foo.cpp",
11 # Expect a request after initial preamble build.
12 # CHECK: "method": "workspace/semanticTokens/refresh",
13 # CHECK-NEXT: "params": null
17 {"jsonrpc":"2.0","id":0}
19 # Preamble stays the same, no refresh requests.
20 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{
21 "textDocument": {"uri":"test:///foo.cpp","version":2},
22 "contentChanges":[{"text":"int x = 2;\nint y = 3;"}]
24 # CHECK-NOT: "method": "workspace/semanticTokens/refresh"
27 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{
28 "textDocument": {"uri":"test:///foo.cpp","version":2},
29 "contentChanges":[{"text":"#define FOO"}]
31 # Expect a request after initial preamble build.
32 # CHECK: "method": "workspace/semanticTokens/refresh",
33 # CHECK-NEXT: "params": null
36 # Reply with error, to make sure there are no crashes.
37 {"jsonrpc":"2.0","id":1,"error":{"code": 0, "message": "msg"}}
39 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
41 {"jsonrpc":"2.0","method":"exit"}