|
| 1 | +# RUN: rm -rf %t.dir/* && mkdir -p %t.dir |
| 2 | +# RUN: echo '[{"directory": "%/t.dir", "command": "clang++ -fsycl main.cpp", "file": "main.cpp"}]' > %t.dir/compile_commands.json |
| 3 | +# RUN: sed -e "s|INPUT_DIR|%/t.dir|g" %s > %t.test.1 |
| 4 | + |
| 5 | +# On Windows, we need the URI in didOpen to look like "uri":"file:///C:/..." |
| 6 | +# (with the extra slash in the front), so we add it here. |
| 7 | +# RUN: sed -E -e 's|"file://([A-Z]):/|"file:///\1:/|g' %t.test.1 > %t.test |
| 8 | + |
| 9 | +# RUN: clangd -lit-test < %t.test | FileCheck -strict-whitespace %t.test |
| 10 | + |
| 11 | +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"initializationOptions":{"compilationDatabasePath":"INPUT_DIR"}}} |
| 12 | +--- |
| 13 | +{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"#include <sycl/sycl.hpp>\nsycl::queue q{};"}}} |
| 14 | +--- |
| 15 | +{"jsonrpc":"2.0","id":1,"method":"textDocument/symbolInfo","params":{ |
| 16 | + "textDocument":{"uri":"test:///main.cpp"}, |
| 17 | + "position":{"line":1,"character":13} |
| 18 | +}} |
| 19 | +# CHECK: "id": 1 |
| 20 | +# CHECK-NEXT: "jsonrpc": "2.0", |
| 21 | +# CHECK-NEXT: "result": [ |
| 22 | +# CHECK-NEXT: { |
| 23 | +# CHECK-NEXT: "containerName": "sycl::queue::", |
| 24 | +# CHECK-NEXT: "declarationRange": { |
| 25 | +# CHECK-NEXT: "range": { |
| 26 | +# CHECK-NEXT: "end": { |
| 27 | +# CHECK-NEXT: "character": 16, |
| 28 | +# CHECK-NEXT: "line": 124 |
| 29 | +# CHECK-NEXT: }, |
| 30 | +# CHECK-NEXT: "start": { |
| 31 | +# CHECK-NEXT: "character": 11, |
| 32 | +# CHECK-NEXT: "line": 124 |
| 33 | +# CHECK-NEXT: } |
| 34 | +# CHECK-NEXT: }, |
| 35 | +# CHECK-NEXT: "uri": "file://{{.*}}/include/sycl/queue.hpp" |
| 36 | +# CHECK-NEXT: }, |
| 37 | +--- |
| 38 | +{"jsonrpc":"2.0","id":3,"method":"shutdown"} |
| 39 | +--- |
| 40 | +{"jsonrpc":"2.0","method":"exit"} |
0 commit comments