1 # Copy over the server file into test workspace
3 # RUN: cp -r %S/Inputs/path-mappings %t
5 # RUN: clangd --path-mappings 'C:\client=%t/server' -lit-test < %s | FileCheck -strict-whitespace %s
6 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
10 "method": "textDocument/didOpen",
13 "uri": "file:///C:/client/bar.cpp",
15 "text": "#include \"foo.h\"\nint main(){\nreturn foo();\n}"
19 # Ensure that the client gets back the same client path (clangd thinks it edited %t/server/bar.cpp)
20 # CHECK: "method": "textDocument/publishDiagnostics",
21 # CHECK-NEXT: "params": {
22 # CHECK-NEXT: "diagnostics": [],
23 # CHECK-NEXT: "uri": "file:///C:/client/bar.cpp",
24 # CHECK-NEXT: "version": 0
27 # We're editing bar.cpp, which includes foo.h, where foo.h "exists" at a server location
28 # With path mappings, when we go to definition on foo(), we get back a client file uri
32 "method": "textDocument/definition",
35 "uri": "file:///C:/client/bar.cpp"
44 # CHECK-NEXT: "jsonrpc": "2.0",
45 # CHECK-NEXT: "result": [
47 # CHECK-NEXT: "range": {
48 # CHECK-NEXT: "end": {
49 # CHECK-NEXT: "character": {{[0-9]+}},
50 # CHECK-NEXT: "line": {{[0-9]+}}
52 # CHECK-NEXT: "start": {
53 # CHECK-NEXT: "character": {{[0-9]+}},
54 # CHECK-NEXT: "line": {{[0-9]+}}
57 # CHECK-NEXT: "uri": "file:///C:/client/foo.h"
62 {"jsonrpc":"2.0","id":2,"method":"shutdown"}
64 {"jsonrpc":"2.0","method":"exit"}