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