summaryrefslogtreecommitdiff
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2018-11-27 16:40:46 +0000
committerJan Korous <jkorous@apple.com>2018-11-27 16:40:46 +0000
commitfe44a3f93fd8a66b9ff8fbdfd78a82cad22bd54b (patch)
tree16812659a431a057bda486b36b59545a351bde54 /clang-tools-extra/test
parent6b275e4daac2c038dca6f2a1e3f5925e676e9590 (diff)
[clangd] textDocument/SymbolInfo extension
New method returning symbol info for given source position. Differential Revision: https://reviews.llvm.org/D54799 rdar://problem/46050281
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/clangd/symbol-info.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clangd/symbol-info.test b/clang-tools-extra/test/clangd/symbol-info.test
new file mode 100644
index 00000000000..65094a4bd4d
--- /dev/null
+++ b/clang-tools-extra/test/clangd/symbol-info.test
@@ -0,0 +1,14 @@
+# 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":"test:///simple.cpp","languageId":"cpp","version":1,"text":"void foo(); int main() { foo(); }\n"}}}
+---
+{"jsonrpc":"2.0","id":1,"method":"textDocument/symbolInfo","params":{"textDocument":{"uri":"test:///simple.cpp"},"position":{"line":0,"character":27}}}
+# CHECK: "containerName": null,
+# CHECK-NEXT: "id": "CA2EBE44A1D76D2A",
+# CHECK-NEXT: "name": "foo",
+# CHECK-NEXT: "usr": "c:@F@foo#"
+---
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+---
+{"jsonrpc":"2.0","method":"exit"}