brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 8f92be2 Raw
67 lines · plain
1# A smoke test to check that clangd works without compilation database2#3# Windows have different escaping modes.4# FIXME: We should add one for windows.5# UNSUPPORTED: system-windows6#7# RUN: rm -fr %t8# RUN: mkdir -p %t9# RUN: split-file %s %t10#11# RUN: sed -e "s|DIR|%/t|g" %t/definition.jsonrpc.tmpl > %t/definition.jsonrpc12#13# RUN: clangd -experimental-modules-support -lit-test < %t/definition.jsonrpc \14# RUN:      | FileCheck -strict-whitespace %t/definition.jsonrpc15 16#--- A.h17void printA();18 19#--- Use.cpp20#include "A.h"21void foo() {22    print23}24 25#--- definition.jsonrpc.tmpl26{27  "jsonrpc": "2.0",28  "id": 0,29  "method": "initialize",30  "params": {31    "processId": 123,32    "rootPath": "clangd",33    "capabilities": {34      "textDocument": {35        "completion": {36          "completionItem": {37            "snippetSupport": true38          }39        }40      }41    },42    "trace": "off"43  }44}45---46{47  "jsonrpc": "2.0",48  "method": "textDocument/didOpen",49  "params": {50    "textDocument": {51      "uri": "file://DIR/Use.cpp",52      "languageId": "cpp",53      "version": 1,54      "text": "#include \"A.h\"\nvoid foo() {\n    print\n}\n"55    }56  }57}58 59# CHECK: "message"{{.*}}printA{{.*}}(fix available)60 61---62{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"file://DIR/Use.cpp"},"context":{"triggerKind":1},"position":{"line":2,"character":6}}}63---64{"jsonrpc":"2.0","id":2,"method":"shutdown"}65---66{"jsonrpc":"2.0","method":"exit"}67