summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clangd/hover.test
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clangd/hover.test')
-rw-r--r--clang-tools-extra/test/clangd/hover.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clangd/hover.test b/clang-tools-extra/test/clangd/hover.test
new file mode 100644
index 00000000000..8ac7a9c2798
--- /dev/null
+++ b/clang-tools-extra/test/clangd/hover.test
@@ -0,0 +1,19 @@
+# RUN: clangd -lit-test < %s | FileCheck %s
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+---
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///main.cpp","languageId":"cpp","version":1,"text":"void foo(); int main() { foo(); }\n"}}}
+---
+{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":0,"character":27}}}
+# CHECK: "id": 1,
+# CHECK-NEXT: "jsonrpc": "2.0",
+# CHECK-NEXT: "result": {
+# CHECK-NEXT: "contents": {
+# CHECK-NEXT: "kind": "plaintext",
+# CHECK-NEXT: "value": "Declared in global namespace\n\nvoid foo()"
+# CHECK-NEXT: }
+# CHECK-NEXT: }
+# CHECK-NEXT:}
+---
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+---
+{"jsonrpc":"2.0","method":"exit"}
OpenPOWER on IntegriCloud