This revision was automatically updated to reflect the committed changes.
Closed by commit rL300991: [Clangd] Failed to decode params using 
1.x-compatible request message (authored by d0k).

Changed prior to commit:
  https://reviews.llvm.org/D32238?vs=95811&id=96153#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32238

Files:
  clang-tools-extra/trunk/clangd/Protocol.cpp
  clang-tools-extra/trunk/test/clangd/completion.test


Index: clang-tools-extra/trunk/test/clangd/completion.test
===================================================================
--- clang-tools-extra/trunk/test/clangd/completion.test
+++ clang-tools-extra/trunk/test/clangd/completion.test
@@ -30,6 +30,17 @@
 # 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"}
Index: clang-tools-extra/trunk/clangd/Protocol.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/Protocol.cpp
+++ clang-tools-extra/trunk/clangd/Protocol.cpp
@@ -648,7 +648,7 @@
     auto *Value =
         dyn_cast_or_null<llvm::yaml::MappingNode>(NextKeyValue.getValue());
     if (!Value)
-      return llvm::None;
+      continue;
 
     llvm::SmallString<10> Storage;
     if (KeyValue == "textDocument") {


Index: clang-tools-extra/trunk/test/clangd/completion.test
===================================================================
--- clang-tools-extra/trunk/test/clangd/completion.test
+++ clang-tools-extra/trunk/test/clangd/completion.test
@@ -30,6 +30,17 @@
 # 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"}
Index: clang-tools-extra/trunk/clangd/Protocol.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/Protocol.cpp
+++ clang-tools-extra/trunk/clangd/Protocol.cpp
@@ -648,7 +648,7 @@
     auto *Value =
         dyn_cast_or_null<llvm::yaml::MappingNode>(NextKeyValue.getValue());
     if (!Value)
-      return llvm::None;
+      continue;
 
     llvm::SmallString<10> Storage;
     if (KeyValue == "textDocument") {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to