[clang-tools-extra] Fix a link in ReleaseNotes.rst
[llvm-project.git] / clang-tools-extra / clangd / test / did-change-configuration-params.test
blob29cf1786a835ac800632a3bdf8a5c891d8eda2fc
1 # RUN: clangd -compile_args_from=lsp -lit-test < %s 2> %t | FileCheck -strict-whitespace %s
2 # RUN: FileCheck --check-prefix=ERR --input-file=%t %s
3 # UNSUPPORTED: windows-gnu,windows-msvc
4 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
5 ---
6 {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"compilationDatabaseChanges":{"/clangd-test/foo.c": {"workingDirectory":"/clangd-test", "compilationCommand": ["clang", "-c", "foo.c"]}}}}}
7 ---
8 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","text":"int main() { int i; return i; }"}}}
9 #      CHECK:  "method": "textDocument/publishDiagnostics",
10 # CHECK-NEXT:  "params": {
11 # CHECK-NEXT:    "diagnostics": [],
12 # CHECK-NEXT:    "uri": "file://{{.*}}/foo.c",
13 # CHECK-NEXT:    "version": 0
14 # CHECK-NEXT:  }
15 ---
16 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///bar.c","languageId":"c","text":"int main() { int i; return i; }"}}}
17 #      CHECK:  "method": "textDocument/publishDiagnostics",
18 # CHECK-NEXT:  "params": {
19 # CHECK-NEXT:    "diagnostics": [],
20 # CHECK-NEXT:    "uri": "file://{{.*}}/bar.c",
21 # CHECK-NEXT:    "version": 0
22 # CHECK-NEXT:  }
23 ---
24 {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"compilationDatabaseChanges":{"/clangd-test/foo.c": {"workingDirectory":"/clangd-test2", "compilationCommand": ["clang", "-c", "foo.c", "-Wall", "-Werror"]}}}}}
25 #      CHECK:  "method": "textDocument/publishDiagnostics",
26 # CHECK-NEXT:  "params": {
27 # CHECK-NEXT:    "diagnostics": [
28 # CHECK-NEXT:      {
29 # CHECK-NEXT:        "code": "-Wuninitialized",
30 # CHECK-NEXT:        "message": "Variable 'i' is uninitialized when used here (fix available)",
31 # CHECK-NEXT:        "range": {
32 # CHECK-NEXT:          "end": {
33 # CHECK-NEXT:            "character": 28,
34 # CHECK-NEXT:            "line": 0
35 # CHECK-NEXT:          },
36 # CHECK-NEXT:          "start": {
37 # CHECK-NEXT:            "character": 27,
38 # CHECK-NEXT:            "line": 0
39 # CHECK-NEXT:          }
40 # CHECK-NEXT:        },
41 # CHECK-NEXT:        "severity": 1,
42 # CHECK-NEXT:        "source": "clang"
43 # CHECK-NEXT:      }
44 # CHECK-NEXT:    ],
45 # CHECK-NEXT:    "uri": "file://{{.*}}/foo.c",
46 # CHECK-NEXT:    "version": 0
47 # CHECK-NEXT:  }
49 # ERR: ASTWorker building file {{.*}}foo.c version 0 with command
50 # ERR: [{{.*}}clangd-test2]
51 # ERR: clang -c -Wall -Werror {{.*}} -- {{.*}}foo.c
52 ---
53 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
54 ---
55 {"jsonrpc":"2.0","method":"exit"}