llvm-project/clang-tools-extra/test/clangd/completion.test

26 lines
1023 B
Plaintext

# RUN: clangd -run-synchronously < %s | FileCheck %s
# It is absolutely vital that this file has CRLF line endings.
#
Content-Length: 125
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
Content-Length: 211
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///main.cpp","languageId":"cpp","version":1,"text":"struct fake { int a, bb, ccc; };\nint main() {\n fake f;\n f.\n}\n"}}}
Content-Length: 148
{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":3,"character":5}}}
# The order of results returned by ASTUnit CodeComplete seems to be
# nondeterministic, so we check regardless of order.
#
# CHECK: {"jsonrpc":"2.0","id":1,"result":[
# CHECK-DAG: {"label":"a"}
# CHECK-DAG: {"label":"bb"}
# CHECK-DAG: {"label":"ccc"}
# CHECK: ]}
Content-Length: 44
{"jsonrpc":"2.0","id":3,"method":"shutdown"}