2018-02-06 18:47:30 +08:00
|
|
|
# RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
|
|
|
|
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
|
|
|
|
---
|
|
|
|
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","version":1,"text":"int main() { int i; return i; }"},"metadata":{"extraFlags":["-Wall"]}}}
|
|
|
|
# CHECK: "method": "textDocument/publishDiagnostics",
|
|
|
|
# CHECK-NEXT: "params": {
|
|
|
|
# CHECK-NEXT: "diagnostics": [
|
|
|
|
# CHECK-NEXT: {
|
2018-08-15 06:21:40 +08:00
|
|
|
# CHECK-NEXT: "category": "Semantic Issue",
|
2018-08-04 04:43:28 +08:00
|
|
|
# CHECK-NEXT: "message": "Variable 'i' is uninitialized when used here",
|
2018-02-06 18:47:30 +08:00
|
|
|
# CHECK-NEXT: "range": {
|
|
|
|
# CHECK-NEXT: "end": {
|
|
|
|
# CHECK-NEXT: "character": 28,
|
|
|
|
# CHECK-NEXT: "line": 0
|
|
|
|
# CHECK-NEXT: },
|
|
|
|
# CHECK-NEXT: "start": {
|
|
|
|
# CHECK-NEXT: "character": 27,
|
|
|
|
# CHECK-NEXT: "line": 0
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: },
|
|
|
|
# CHECK-NEXT: "severity": 2
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ],
|
|
|
|
# CHECK-NEXT: "uri": "file://{{.*}}/foo.c"
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
---
|
2018-07-26 17:21:07 +08:00
|
|
|
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"test:///foo.c","version":2},"contentChanges":[{"text":"int main() { int i; return i+1; }"}]}}
|
2018-02-06 18:47:30 +08:00
|
|
|
# CHECK: "method": "textDocument/publishDiagnostics",
|
|
|
|
# CHECK-NEXT: "params": {
|
|
|
|
# CHECK-NEXT: "diagnostics": [
|
|
|
|
# CHECK-NEXT: {
|
2018-08-15 06:21:40 +08:00
|
|
|
# CHECK-NEXT: "category": "Semantic Issue",
|
2018-08-04 04:43:28 +08:00
|
|
|
# CHECK-NEXT: "message": "Variable 'i' is uninitialized when used here",
|
2018-02-06 18:47:30 +08:00
|
|
|
# CHECK-NEXT: "range": {
|
|
|
|
# CHECK-NEXT: "end": {
|
|
|
|
# CHECK-NEXT: "character": 28,
|
|
|
|
# CHECK-NEXT: "line": 0
|
|
|
|
# CHECK-NEXT: },
|
|
|
|
# CHECK-NEXT: "start": {
|
|
|
|
# CHECK-NEXT: "character": 27,
|
|
|
|
# CHECK-NEXT: "line": 0
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: },
|
|
|
|
# CHECK-NEXT: "severity": 2
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ],
|
|
|
|
# CHECK-NEXT: "uri": "file://{{.*}}/foo.c"
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
---
|
|
|
|
{"jsonrpc":"2.0","id":5,"method":"shutdown"}
|
|
|
|
---
|
|
|
|
{"jsonrpc":"2.0":"method":"exit"}
|
|
|
|
|
|
|
|
|