[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / tblgen-lsp-server / textdocument-didchange.test
blob06e22977bc8fca23921c35ab795e04e5339a51d3
1 // RUN: tblgen-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"tablegen","capabilities":{},"trace":"off"}}
3 // -----
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///foo.td",
6   "languageId":"tablegen",
7   "version":1,
8   "text":"class Foo<>;"
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": "Unknown token when expecting a type",
16 // CHECK-NEXT:         "range": {
17 // CHECK-NEXT:           "end": {
18 // CHECK-NEXT:             "character": 11,
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": "tablegen"
28 // CHECK-NEXT:       }
29 // CHECK-NEXT:     ],
30 // CHECK-NEXT:     "uri": "test:///foo.td",
31 // CHECK-NEXT:     "version": 1
32 // CHECK-NEXT:   }
33 // -----
34 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
35   "uri":"test:///foo.td",
36   "version":2
37 }, "contentChanges": [{
38   "range":{
39     "start":{"line":0,"character":10},
40     "end":{"line":0,"character":10}
41   },
42   "text": "int"
43 }]}}
44 // CHECK: "method": "textDocument/publishDiagnostics",
45 // CHECK-NEXT: "params": {
46 // CHECK-NEXT:     "diagnostics": [
47 // CHECK-NEXT:       {
48 // CHECK-NEXT:         "category": "Parse Error",
49 // CHECK-NEXT:         "message": "Expected identifier in declaration",
50 // CHECK-NEXT:         "range": {
51 // CHECK-NEXT:           "end": {
52 // CHECK-NEXT:             "character": 14,
53 // CHECK-NEXT:             "line": 0
54 // CHECK-NEXT:           },
55 // CHECK-NEXT:           "start": {
56 // CHECK-NEXT:             "character": 13,
57 // CHECK-NEXT:             "line": 0
58 // CHECK-NEXT:           }
59 // CHECK-NEXT:         },
60 // CHECK-NEXT:         "severity": 1,
61 // CHECK-NEXT:         "source": "tablegen"
62 // CHECK-NEXT:       }
63 // CHECK-NEXT:     ],
64 // CHECK-NEXT:     "uri": "test:///foo.td",
65 // CHECK-NEXT:     "version": 2
66 // CHECK-NEXT:   }
67 // -----
68 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
69   "uri":"test:///foo.td",
70   "version":3
71 }, "contentChanges": [
72   {
73     "range":{
74       "start":{"line":0,"character":13},
75       "end":{"line":0,"character":13}
76     },
77     "text": " i"
78   },
79   {
80     "range":{
81       "start":{"line":0,"character":15},
82       "end":{"line":0,"character":17}
83     },
84     "text": "> { int x = i; }"
85   }
86 ]}}
87 // CHECK: "method": "textDocument/publishDiagnostics",
88 // CHECK-NEXT: "params": {
89 // CHECK-NEXT:     "diagnostics": [],
90 // CHECK-NEXT:     "uri": "test:///foo.td",
91 // CHECK-NEXT:     "version": 3
92 // CHECK-NEXT:   }
93 // -----
94 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
95 // -----
96 {"jsonrpc":"2.0","method":"exit"}