summaryrefslogtreecommitdiff
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2018-12-20 15:39:12 +0000
committerHaojian Wu <hokein@google.com>2018-12-20 15:39:12 +0000
commit5aae4643a2150c18f6770fee608a14f1fdd108e0 (patch)
tree9307b33d91950cf03efb4fab2d4b49608bce1be9 /clang-tools-extra/test
parentd2690d6263f3be9067d9f3304d8e1a68c081acc9 (diff)
[clangd] Expose FileStatus to LSP.
Summary: Add an LSP extension "textDocument/clangd.fileStatus" to emit file-status information. Reviewers: ilya-biryukov Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55363
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/clangd/filestatus.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clangd/filestatus.test b/clang-tools-extra/test/clangd/filestatus.test
new file mode 100644
index 00000000000..c485939b5c5
--- /dev/null
+++ b/clang-tools-extra/test/clangd/filestatus.test
@@ -0,0 +1,13 @@
+# RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"initializationOptions":{"clangdFileStatus": true},"trace":"off"}}
+---
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"int x; int y = x;"}}}
+# CHECK: "method": "textDocument/clangd.fileStatus",
+# CHECK-NEXT: "params": {
+# CHECK-NEXT: "state": "parsing includes",
+# CHECK-NEXT: "uri": "{{.*}}/main.cpp"
+# CHECK-NEXT: }
+---
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+---
+{"jsonrpc":"2.0","method":"exit"}