Bump version to 19.1.0git
[llvm-project.git] / clang-tools-extra / clangd / test / document-link.test
blob36977753478a0ce4a141061a997ca7ce13d209fd
1 # Create a fake resource_dir so that the test can find the headers.
2 # RUN: rm -rf %/t
3 # RUN: mkdir -p %t/include/ && touch %t/include/foo.h
4 # RUN: clangd -lit-test -resource-dir=%t < %s | FileCheck -strict-whitespace %s
5 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
6 ---
7 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"#include <foo.h>"}}}
8 ---
9 {"jsonrpc":"2.0","id":2,"method":"textDocument/documentLink","params":{"textDocument":{"uri":"test:///main.cpp"}}}
10 #      CHECK:  "id": 2,
11 # CHECK-NEXT:  "jsonrpc": "2.0",
12 # CHECK-NEXT:  "result": [
13 # CHECK-NEXT:    {
14 # CHECK-NEXT:      "range": {
15 # CHECK-NEXT:        "end": {
16 # CHECK-NEXT:          "character": 16,
17 # CHECK-NEXT:          "line": 0
18 # CHECK-NEXT:        },
19 # CHECK-NEXT:        "start": {
20 # CHECK-NEXT:          "character": 9,
21 # CHECK-NEXT:          "line": 0
22 # CHECK-NEXT:        }
23 # CHECK-NEXT:      },
24 # CHECK-NEXT:      "target": "file://{{.*}}/foo.h"
25 # CHECK-NEXT:    }
26 # CHECK-NEXT:  ]
27 # CHECK-NEXT:}
29 ---
30 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
31 ---
32 {"jsonrpc":"2.0","method":"exit"}