1# RUN: clangd -lit-test < %s | FileCheck %s 2{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} 3--- 4{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"void foo(); int main() { foo(); }\n"}}} 5--- 6{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":27}}} 7# CHECK: "id": 1, 8# CHECK-NEXT: "jsonrpc": "2.0", 9# CHECK-NEXT: "result": { 10# CHECK-NEXT: "contents": { 11# CHECK-NEXT: "kind": "plaintext", 12# CHECK-NEXT: "value": "function foo\n\n→ void\n\nvoid foo()" 13# CHECK-NEXT: }, 14# CHECK-NEXT: "range": { 15# CHECK-NEXT: "end": { 16# CHECK-NEXT: "character": 28, 17# CHECK-NEXT: "line": 0 18# CHECK-NEXT: }, 19# CHECK-NEXT: "start": { 20# CHECK-NEXT: "character": 25, 21# CHECK-NEXT: "line": 0 22# CHECK-NEXT: } 23# CHECK-NEXT: } 24# CHECK-NEXT: } 25# CHECK-NEXT:} 26--- 27{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":10}}} 28# CHECK: "id": 1, 29# CHECK-NEXT: "jsonrpc": "2.0", 30# CHECK-NEXT: "result": null 31--- 32{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main2.cpp","languageId":"cpp","version":1,"text":"enum foo{}; int main() { foo f; }\n"}}} 33--- 34{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main2.cpp"},"position":{"line":0,"character":27}}} 35# CHECK: "id": 1, 36# CHECK-NEXT: "jsonrpc": "2.0", 37# CHECK-NEXT: "result": { 38# CHECK-NEXT: "contents": { 39# CHECK-NEXT: "kind": "plaintext", 40# CHECK-NEXT: "value": "enum foo\n\nenum foo {}" 41# CHECK-NEXT: }, 42# CHECK-NEXT: "range": { 43# CHECK-NEXT: "end": { 44# CHECK-NEXT: "character": 28, 45# CHECK-NEXT: "line": 0 46# CHECK-NEXT: }, 47# CHECK-NEXT: "start": { 48# CHECK-NEXT: "character": 25, 49# CHECK-NEXT: "line": 0 50# CHECK-NEXT: } 51# CHECK-NEXT: } 52# CHECK-NEXT: } 53# CHECK-NEXT:} 54--- 55{"jsonrpc":"2.0","id":3,"method":"shutdown"} 56--- 57{"jsonrpc":"2.0","method":"exit"} 58