summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/Protocol.cpp2
-rw-r--r--clang-tools-extra/test/clangd/completion.test11
2 files changed, 12 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index 5a2f2ae6747..016d8fd5f3f 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -648,7 +648,7 @@ TextDocumentPositionParams::parse(llvm::yaml::MappingNode *Params) {
auto *Value =
dyn_cast_or_null<llvm::yaml::MappingNode>(NextKeyValue.getValue());
if (!Value)
- return llvm::None;
+ continue;
llvm::SmallString<10> Storage;
if (KeyValue == "textDocument") {
diff --git a/clang-tools-extra/test/clangd/completion.test b/clang-tools-extra/test/clangd/completion.test
index 57189ad9c66..e3f3ffade92 100644
--- a/clang-tools-extra/test/clangd/completion.test
+++ b/clang-tools-extra/test/clangd/completion.test
@@ -30,6 +30,17 @@ Content-Length: 146
# CHECK-DAG: {"label":"bb","kind":5}
# CHECK-DAG: {"label":"ccc","kind":5}
# CHECK: ]}
+
+Content-Length: 172
+
+{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///main.cpp"},"uri":"file:///main.cpp","position":{"line":3,"character":5}}}
+# Test params parsing in the presence of a 1.x-compatible client (inlined "uri")
+#
+# CHECK: {"jsonrpc":"2.0","id":1,"result":[
+# CHECK-DAG: {"label":"a","kind":5}
+# CHECK-DAG: {"label":"bb","kind":5}
+# CHECK-DAG: {"label":"ccc","kind":5}
+# CHECK: ]}
Content-Length: 44
{"jsonrpc":"2.0","id":3,"method":"shutdown"}
OpenPOWER on IntegriCloud