[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / mlir-lsp-server / diagnostics.test
blob99edd11b574f54819ff8996d92b6175e5d213850
1 // RUN: mlir-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"mlir","capabilities":{},"trace":"off"}}
3 // -----
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///foo.mlir",
6   "languageId":"mlir",
7   "version":1,
8   "text":"func.func ()"
9 }}}
10 // CHECK: "method": "textDocument/publishDiagnostics",
11 // CHECK-NEXT: "params": {
12 // CHECK-NEXT:     "diagnostics": [
13 // CHECK-NEXT:       {
14 // CHECK-NEXT:         "category": "Parse Error",
15 // CHECK-NEXT:         "message": "custom op 'func.func' expected valid '@'-identifier for symbol name",
16 // CHECK-NEXT:         "range": {
17 // CHECK-NEXT:           "end": {
18 // CHECK-NEXT:             "character": 12,
19 // CHECK-NEXT:             "line": 0
20 // CHECK-NEXT:           },
21 // CHECK-NEXT:           "start": {
22 // CHECK-NEXT:             "character": 10,
23 // CHECK-NEXT:             "line": 0
24 // CHECK-NEXT:           }
25 // CHECK-NEXT:         },
26 // CHECK-NEXT:         "severity": 1,
27 // CHECK-NEXT:         "source": "mlir"
28 // CHECK-NEXT:       }
29 // CHECK-NEXT:     ],
30 // CHECK-NEXT:     "uri": "test:///foo.mlir",
31 // CHECK-NEXT:     "version": 1
32 // CHECK-NEXT:   }
33 // -----
34 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
35   "uri":"test:///foo.mlir",
36   "languageId":"mlir",
37   "version":1,
38   "text":"\"\""
39 }}}
40 // CHECK: "method": "textDocument/publishDiagnostics",
41 // CHECK-NEXT: "params": {
42 // CHECK-NEXT:     "diagnostics": [
43 // CHECK-NEXT:       {
44 // CHECK-NEXT:         "category": "Parse Error",
45 // CHECK-NEXT:         "message": "empty operation name is invalid",
46 // CHECK-NEXT:         "range": {
47 // CHECK-NEXT:           "end": {
48 // CHECK-NEXT:             "character": 2,
49 // CHECK-NEXT:             "line": 0
50 // CHECK-NEXT:           },
51 // CHECK-NEXT:           "start": {
52 // CHECK-NEXT:             "character": 0,
53 // CHECK-NEXT:             "line": 0
54 // CHECK-NEXT:           }
55 // CHECK-NEXT:         },
56 // CHECK-NEXT:         "severity": 1,
57 // CHECK-NEXT:         "source": "mlir"
58 // CHECK-NEXT:       }
59 // CHECK-NEXT:     ],
60 // CHECK-NEXT:     "uri": "test:///foo.mlir",
61 // CHECK-NEXT:     "version": 1
62 // CHECK-NEXT:   }
63 // -----
64 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
65 // -----
66 {"jsonrpc":"2.0","method":"exit"}